Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Aakash Srivastav
Full Stack JavaScript Techdegree Student 11,626 Pointsbackground-size
Whats the difference between - background-size: 100% 100%; and background-size: cover; Please explain . I read articles and also took help of w3c , but didn't found any result.
1 Answer

Patrik Horváth
11,097 Pointsand my answere stay same :
background-size:100%;
is same as
background-size:100% auto;
= the width is set to be 100% large and the height of the background image follows respecting the image aspect ratio.
background-size:cover;
means the background image will always fit the whole div , you won't be left with any empty spots in your div
background-size:100% 100%;
won't leave any empty space too, but of course this will destroy the original image aspect ratio