Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS CSS Flexbox Layout Building a Layout with Flexbox Creating a Sticky Footer with Flexbox

3 Answers

Steven Parker
Steven Parker
231,275 Points

Those properties will work the same when the contents fit within the value specified.

The difference will be seen when the contents are too large to fit in the value. In that case the item with the "min-height" property will expand but the one where "height" is set will either overflow or be clipped, depending on the setting of the container.

Vito Huang
Vito Huang
7,281 Points

Steven Parker thank you for your clear explanation. I still couldn't understand why the one where "height" is set would either overflow or be clipped. Could you please explain it a bit more?

Steven Parker
Steven Parker
231,275 Points

Where "min-height" just sets a limit (and the actual size can be larger if space is available), the "height" value is a specific size that should be adhered to. If the actual object is larger than this value, the browser will normally shrink it down to fit or in the case of a background, clip any portion that doesn't fit.

I suggest that a little experimentation will be far more valuable than any explanations.

Vito Huang
Vito Huang
7,281 Points

Thanks, Steven. I think I got the point.