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 How to Make a Website Styling Web Pages and Navigation Make a CSS Image Gallery

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

Am completely clueless

css/main.css
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;
}
img {
  maximum-width:100%;
}

5 Answers

Justin Horner
STAFF
Justin Horner
Treehouse Guest Teacher

Hello Tumayi,

You're close! You have the right idea, but the CSS property is called max-width.

img {
 max-width: 100%; 
}

I hope this helps.

" Bummer! It doesn't look like you set the maximum width on images yet."This is the response I got

Justin Horner
Justin Horner
Treehouse Guest Teacher

I just tested this and I'm able to pass the first step of the challenge. Which step are you on? Also, make sure that you're adding the code I provided at the end of the css file.

That is exactly what I did.

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; } img { max- width:100%; }

Justin Horner
Justin Horner
Treehouse Guest Teacher

Ah, I think the issue is that there's an extra space between "max-" and "width". Remove that space so that it reads "max-width".

Thanks for your help and patience Justin I finally aced it