|
Posted by Jim Moe on 03/09/06 00:29
julian_m wrote:
>
>> - Add float:left to each column. The columns will not float unless you
>> tell them to do so.
>
> But, if I have two divs inside another, and float one of them to left,
> should the 2nd one float to left as well?
>
No. Why would it? If you do not tell it to float, it won't. There is no
"Well, my neighbor is floating. I think I will, too."
> why the childs divs (#izq and #der) don't fit inside the parent div
> (#ppal) ?
>
They do fit. Just not the way you envision.
You have no normal content in #ppal. All content is floated and as such
is removed from the normal flow. Thus the #ppal's height is zero.
Here is a way to get #ppal to wrap the floated divs:
..clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
Add clearfix to ppal: <div id="ppal" class="clearfix">
See <http://www.positioniseverything.net/easyclearing.html> for a
complete discussion.
--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Navigation:
[Reply to this message]
|