Aleve Sicofante wrote:
> I'm fairly new to CSS and I'm having a hard time understanding how to
>  set the height of nested divs.

Generally: you don't set height on nested divs. Instead you let them
expand freely in height so the outer contains the inner. That's what
you're asking for, I think.

IE6 makes elements expand by default when you set dimensions on an
element, because of the 'hasLayout'[1] bug. It may look alright (in
IE6), but you should *not* rely on that IE/win bug since doing so tends
to break the layout in all other browsers.

Compliant browsers (including IE7 in this case) will respect set
dimensions - regardless of how wrong those dimensions are, and will not
expand elements beyond those dimensions unless you let them.

> http://www.vieira.es/test/index.html

Add...
#centro {height: 1%; overflow: hidden; }
...that has a 'hasLayout'[1] trigger for IE6 (height: 1%) and introduces
a new 'block formatting contexts'[2] in standard compliant browsers
(overflow: hidden}.

If that doesn't work well enough, then use the following instead...
#centro {height: auto; zoom: 1; display: table; }
...which makes use of the same IE-bugs and standards.
BTW: setting 'height: auto;' is the same as not setting a height at all,
since 'height: auto' is default. So, you can just delete the 'height:
300px;' you have there now.

> http://www.vieira.es/test/maquinaria.html

Basically: delete unnecessary height-values - that is: most of them, and
use the same styles as for the other example to achieve expansion of the
elements you want to expand.

regards
        Georg

[1]http://www.satzansatz.de/cssd/onhavinglayout.html
[2]http://www.w3.org/TR/CSS21/visuren.html#q15
-- 
http://www.gunlaug.no
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to