The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

expand div’s height to fit its container

  • # November 27, 2012 at 4:15 pm

    I have a container div with two inner divs, one below the other(not floated), and the first inner div with a fixed height. The question is: how can I make the second div to expand its height to fit its parent?

    # November 27, 2012 at 4:40 pm

    I am not understanding what you are trying to accomplish. can you show us your code?

    # November 27, 2012 at 9:05 pm

    Its parent is only as tall as the two child divs, unless you’ve set a height.

    # November 27, 2012 at 10:48 pm

    Got it completely, so here you go

    Keep in mind it isn’t fool proof and has some pitfalls

    # November 28, 2012 at 1:12 am

    @Schwarttzy – .container needs to be height: 400px; not min-height: 400px;. Do that, and it works.

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

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed