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

HTML

Add CSS that will allow all images to fill their parent element.

I put:

img { max-width: 45%; }

2 Answers

Steven Parker
Steven Parker
229,005 Points

You forgot to provide a link to the actual challenge, but...

...a max-width of less than 100% would guarantee that the element will not fill its parent.

Steven Parker
Steven Parker
229,005 Points

The correct property is max-width, since it says allow it to fill, not require it to fill. But to allow the element to completely fill the parent, it must be 100%.

img {
  max-width: 100%;
}