Grow your CSS skills. Land your dream job.

Nested Height Inheritance

  • # July 10, 2008 at 11:24 am

    Hi. I’m wondering if it’s possible to inherit the height of a parent where the parent’s height is set to auto? What I would like is the child element below to size itself to the parent, but really, the content element is what sets the height. Is this possible?

    For example:

    Code:
    div#parent{
    height: auto; /* yeah yeah… I know that this is redundant since it’s the default. :-) */
    }

    div#child{
    height: inherit;
    border:#000 1px solid;
    }

    div#content{
    height:auto;
    }

    HTML:

    Code:
    Oh… the misery of floating elements.
    # July 10, 2008 at 3:18 pm

    You meant "height: 100%"? ;)

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".