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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Troy Fletcher](https://secure.gravatar.com/avatar/897e870f78470a0247a7c93a370c77e8?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Troy Fletcher
2,814 PointsNeed assistance with step
Add CSS that will allow all images to fill their parent element.
a {
text-decoration: none;
}
#wrapper {
max-width: 940px;
margin: 15px 0;
padding: 0 5%;
}
#logo {
text-align: center;
margin: 0;
}
h1, h2 {
color: #fff;
}
nav a {
color: #fff;
}
nav a:hover {
color: #32673f;
}
h1 {
font-family: Changa One, sans-serif;
font-size: 1.75em;
font-weight: normal;
}
2 Answers
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,688 PointsOkay, here's a few hints:
- you need to make a new rule
- you're styling images, so you probably want the rule's selector to target the IMG element tag
- the property to cause something to expand but still be flexible is
max-width
- since you don't know the size of the parent, you may want to specify the value as a percentage
I'm betting you can get it now without an explicit spoiler.
![Maximillian Fox](https://secure.gravatar.com/avatar/0493b5ec23a761e8b76173de6309ea80?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Maximillian Fox
Courses Plus Student 9,236 PointsNick will have mentioned it in a previous video, the best thing I recommend is to go back to the previous ones and have a quick recap. Did you follow along on workspaces? If so the answer may already be in your css file :)
By 'fill their parent element' it means that the image will want to go as big as the element they are contained in.
For example
<div>
<img src="someimage.jpg" />
</div>
The 'parent' of the img element is the div element. So if the image is naturally 300x300px and the div is 400x400px, if the image is at 100% of its size as a maximum, it will try to fill out the div. But if the div was resized to say 200x200px, if you set a certain css property on your img, it WILL go smaller as the div containing it shrinks.
Don't be discouraged, keep going and remember a website wasn't built in a day (or was that Rome? Hmm...)
Unsubscribed User
Courses Plus Student 3,156 PointsUnsubscribed User
Courses Plus Student 3,156 PointsI'm also on this and I have no idea what is going on. I'm really struggling to understand a lot of this CSS and feeling very demotivated to continue.
I don't even know what this question is asking me to do.