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

Max-height

Why does the .main-header's height shrink down to 616.28 when I change the height: 850px to max-height: 850px ? When I just use height: 850px it divides the padding and content area (680 + 170) so that adds up but the total height becomes 616 when I change it to max-height.

1 Answer

Hi Loftur,

When you use height, you tell the browser that the height IS and should be 850px in your case. Using max-height you tell the browser the elements max-height is 850px, it can be smaller than the max height, but can't grow further than the max height.

I hope that helps,

Jonas

Of course

Thank you