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 How to Make a Website Adding Pages to a Website Add Iconography

Elias Valdez
Elias Valdez
692 Points

min-height value when background-size is used

In the video Nick uses both the min-value property and background-size property. If you are fixing the size of the background image with background-size, what do you gain from using min-value?

1 Answer

background-size will only fix the size of an image.

min-height will fix the size of an element (<li>, <p>, etc.). So, if you have a background-size: 50px 50px for an image, you want to set min-height of the element the image is in to at least 50px or part of the image may be cut off.