CSS Float | SoloLearn: Learn to code for FREE!

+1

CSS Float

So an element that is floating left within a bigger element/container just means: The element is aligned left within it's container But every other element also inside the container can 'wrap' around it? So making an element float kinda makes it an inline element right? And to confirm, clear just tells what elements AREN'T allowed to float?

css

3/18/2019 12:48:04 AM

J3fro C

2 Answers

New Answer

+4

Yes, float:left makes it act like an inline element. The next element will go to the right of it, as long as it fits. If the second element doesn’t have the float:left, the floating will be done and the next element will go below it. Clear removes floating. You can specify which floating to remove. Most common is clear:both. https://www.w3schools.com/CSSref/pr_class_clear.asp

0

#titanic { float: none; }