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

CSS How to Make a Website Adding Pages to a Website Make an About Page

Maximilian Stöhr
Maximilian Stöhr
7,479 Points

Code Challenge Error

The Error is: Did you set the max width to 150px? In my code, i have "img { max-width: 150px; } What's my fault?

4 Answers

Hey again,

I have just re-done the quiz, and here is my code, which was successful:

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

Hope this helps, and it would be nice if you could update me as to what went wrong?

Cheers =)

Maximilian Stöhr
Maximilian Stöhr
7,479 Points

Thank you a lot man, my fault was maybe to put it at the top of the css file.. I'm just too lazy to scroll :O

Hey Maximilian,

Can you post your whole code? Sometimes the quiz only wants what it asks for, so if you have added anything to the max-width property, it may overlook your 'correct code'.

Maximilian Stöhr
Maximilian Stöhr
7,479 Points

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

That's all I've added in the challenge, and the img in the html-file ofc... 4 out of 5 steps were successfulll.. Thank you for the answer btw :)

Ahhh I see what went wrong.

You have targeted the same element twice, its best practice to tackle the stylings using as least code as possible (as we're lazy =P}