Home
CSS
CSS Float
CSS Clear
Tryit: Using float and clear
Run ❯
Get your
own
website
❯
Run Code
Ctrl+Alt+R
Save Code
Ctrl+Alt+A
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Go to Spaces
Ctrl+Alt+P
Without clear
div1
div2 - Notice that div2 is after div1 in the HTML code. However, since div2 has no clear, the text in div2 floats around div1.
With clear: left
div3
div4 - Here, clear: left; pushes div4 down below the floating div3, on its left side.