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 trialJim Awofadeju
4,097 PointsHow to fill parent elements
I am having difficulty coming up with code for filling images to their parent elements. I am familiar with the concept of nesting tags within tags, but am not as familiar with filling parent elements. Can you give me some suggestions for what CSS selector(s) and properties I should use?
a {
text-decoration: none;
}
#wrapper {
max-width: 940px;
margin: 0 auto;
}
#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;
}
li img {
max-width: 45%;
margin: 2.5%;
}
2 Answers
Jennifer Nordell
Treehouse TeacherTry this:
min-width: 100%;
That should fill the parent element.
Jim Awofadeju
4,097 PointsI submitted the code below and was able to complete the first of four challenge tasks.
img { max-width: 100%; min-width: 100%; }
I went on to complete the next three challenge tasks. Thank you for providing me with this missing line of code.
Jennifer Nordell
Treehouse TeacherHappy to help! :)