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 Style New Pages

css won't work with my profile picture

I'm using safari browser and my code for him is this

img src="img/richard.jpg" alt:"photo of Richard " class:"pp"

and for css is this

.pp { display: block; max-width:150px; margin: 0 auto 30px; border-radius:20px;

}

note: in the html code i did use those <> properly it wouldn't show on my preview

1 Answer

Mary Yang
Mary Yang
1,769 Points

Hi,

To show code on the forum wrap it in three ` back tick marks. Three at the start and three at the end.

You can't access the picture via class because you defined the class incorrectly in your HTML.

Your code:

<img src="img/richard.jpg" alt:"photo of Richard " class:"pp">

Correct code:

<img src="img/richard.jpg" alt="photo of Richard" class="pp">

It's usually a good idea to try to make your classes descriptive of what they are defining. So in this case your class could be something like class="user-pic".

Thank you very much! just goes to show that one simple error can make it all worse and ill use a different class. thanks for the tip!

Mary Yang
Mary Yang
1,769 Points

My pleasure. Glad I could help.