CSS clear question
-
I consider myself pretty fluent with CSS but something I’m trying to do with clear is baffling me. I took the code below from a tutorial site. It’s 2 divs floated left. The first one has “clear:right”. My understanding of clear is (from W3Schools) “The clear property specifies which sides of an element where other floating elements are not allowed.” Should “clear:right” push div2 down below div1?
<style type="text/css"> div.clear { border:1px solid #ff9900; width:120px; float:left; clear:right; } div.float { border:1px solid #cccccc; width:120px; float: left; } </style> <div class="clear">Div1 with float:left and clear:right</div> <div class="float"><p>Div2 with float:left </div>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘CSS clear question’ is closed to new replies.