You are here: Re: css nested divs style « HTML « IT news, forums, messages
Re: css nested divs style

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация