CSS-Tricks is brought to you in part by Media Temple, the web hosting that we both use and recommend.
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?
I am not understanding what you are trying to accomplish. can you show us your code?
Its parent is only as tall as the two child divs, unless you’ve set a height.
Got it completely, so here you go http://codepen.io/anon/pen/qBneu
Keep in mind it isn’t fool proof and has some pitfalls
@Schwarttzy – .container needs to be height: 400px; not min-height: 400px;. Do that, and it works.
You must be logged in to reply to this topic.
Search for Stuff
Browse the Archives
Get the Newsletter
... or get the RSS feed