css float - floating div not coming in inner div -
whenever div floated left or right, overlows container div. div fits container div if float property removed. how come being occured? please tell me. please refer jsfiddle @ http://jsfiddle.net/ztjzs/. foollowing code :-
<div class="main"> <div class="left-content"> example content<br /> example content<br /> example content<br /> </div> </div> the css code can found in fiddle... in advance.
that way works floating items - floating content "does not count" parent item's height. work around it, have choose of options:
- make
.maindiv floating well, can seen in this version of fiddle. may, however, not acceptable layout. - use
overflow:automake outer div span inner one. "new solution" described here works well: http://www.quirksmode.org/css/clearing.html how looks in fiddle.
Comments
Post a Comment