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 Adding Pages to a Website Make an About Page

I can't pass the code challenge

Why is this code challenge wrong?

Give the image a maximum width of 150 pixels and a border radius of 100%.

img { display: block; margin: 30px 0; border-radius: 100%; max-width: 150px; } the Bummer says: did you set the max width to 150 px?

6 Answers

Hi William,

Are you putting this css at the top? That could be one explanation. Part way down the css there is another img selector which sets max-width: 100% This would override your max-width setting. Putting the css at the bottom solves this. However, now you're overriding the 100% width for other images. The challenge lets this pass but probably shouldn't.

i suspect the challenge wants you to select the image using the class name .profile-photo This way you don't override the max-width: 100% for other images.

Michelle Cannito
Michelle Cannito
8,992 Points

Sometimes the quizzes want ONLY what is asked for. Try with just the 2 attributes asked for.

Try eliminating the 0 at the end of the margin.

the other attributes were previous steps of the challenge so if i delete them it says that the previous challenge is missing

Chris Shaw
Chris Shaw
26,676 Points

Hi William,

I think the margin you have set is the issue, the task asks only for the bottom margin to be set to 30px not the top margin.

img {
  border-radius: 100%;
  display: block;
  max-width: 150px;
  margin: 0 auto 30px;
}

Hi Chris well i did pass the task where they ask me to set the margin and i did it that way, i didn't notice that when i put the code in the question i delete some stuff, but i did it just like you code it. The problem is when I set the max width in the last task, i wrote the same code you did, but it keeps telling me that it's wrong