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 trialWilliam Schatz
1,557 PointsI 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
Jason Anello
Courses Plus Student 94,610 PointsHi 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
8,992 PointsSometimes the quizzes want ONLY what is asked for. Try with just the 2 attributes asked for.
Tristan Gaebler
6,204 PointsTry eliminating the 0 at the end of the margin.
William Schatz
1,557 Pointsthe other attributes were previous steps of the challenge so if i delete them it says that the previous challenge is missing
Chris Shaw
26,676 PointsHi 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;
}
William Schatz
1,557 PointsHi 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