layout - CSS: Why block element wrap around floating element -



layout - CSS: Why block element wrap around floating element -

see illustration @ http://jsfiddle.net/w1xhpp2c/. don't understand why div.b wrapped around float element. thought inline element wrap float elements, while block elements not.

.wrap{ width: 500px; } .a{ float: left; width: 200px; } .b{ background-color:#eee; width:500px; } <div class="wrap"> <div class="a"> a<br/> a<br/> </div> <div class="b"> b<br/> b<br/> b<br/> </div> </div>

block boxes flow under floating elements. css 2.1 spec says

since float not in flow, non-positioned block boxes created before , after float box flow vertically if float didn’t exist

css layout

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -