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

Add CSS that will allow all images to fill their parent element. What does this mean?

This is task 1 of 4 in how to build a website, there is no html code to ruse as referance.

2 Answers

try this:

img { max-width: 100%; }

What it means is that if you have a picture you want to display, but the area in which you have to display it is smaller than the picture, setting the max-width of the image to 100% will re-size the picture so that the whole picture displays inside the area. This will prevent the image from being too large with the bottom and right hand side of it getting cut off.