Tutorials
Start Learning
Learn HTML
Learn CSS
Learn JavaScript
TUTORIALS
THE WORLD'S LARGEST WEB DEVELOPER SITE
Edit & Run
Without clear
div1
div2 - Notice that the div2 element is after div1, in the HTML code. However, since div1 is floated to the left, this happens: the text in div2 is floated around div1, and div2 surrounds the whole thing.
Using clear
div3
div4 - Using clear moves div4 down below the floated div3. The value "left" clears elements floated to the left. You can also clear "right" and "both".
Top Tutorials
HTML Tutorial
CSS Tutorial
JavaScript Tutorial
Top References
HTML Reference
CSS Reference
JavaScript Reference
Top Examples
HTML Examples
CSS Examples
JavaScript Examples
Web Certificates
HTML Certificate
CSS Certificate
JavaScript Certificate