Couldn't you use padding and negative margins?

div1 {height:100%; padding:2em 0 0 0;}
div2 {height:2em; margin:-2em 0 0 0;}

<div id="div1">
<div id="div2"></div>
</div>


David Merwin
[EMAIL PROTECTED]
541-335-1832
http://www.davemerwin.com
http://www.purebluedesign.com
http://www.betachurch.org
http://www.agiprofessional.com



On Oct 24, 2006, at 11:55 AM, Paul Novitski wrote:

> This is likely one of those Gordian knots of CSS:  how to combine
> percentages and ems in the same layout.
>
> I want to style a block that fills the vertical space of the
> viewport, minus the 2ems taken up by the header.  How to express 100%
> - 2em in CSS?
>
> Before I fall back on JavaScript (or *gasp* table markup), I'd like
> to plumb the well of CSS community knowledge.  None of the 100%
> height solutions I've found so far address this wrinkle.
>
> Here's an illustration of the layout I'm after, but 'cheating' by
> using a percentage for the header height as well as the content block:
> http://juniperwebcraft.com/test/PercentMinusEmsProblem.html
>
> Please understand that I'm not looking for a faux layout in which the
> eye is fooled, you know, by giving the content block 100% height and
> letting the header reside inside or overlay it with absolute
> positioning.  Because my content block will contain a Flash object
> that will expand to the dimensions of its container, I need the
> container to truly begin at the bottom of the header.
>
> Thanks,
> Paul
>
> ______________________________________________________________________
> 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/

______________________________________________________________________
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