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

Style New Pages Video - CSS Not Working

I have my HTML and CSS files exactly like Nick does in the video. But for some reason, the CSS for the class profile-photo is not working in my file. My About page does not change at all. Anyone else having this problem? How do I fix it? Thanks!

Stone Preston
Stone Preston
42,016 Points

could you post your relevant html and css for your profile photo please? see the markdown cheatsheet which is linked in the bottom right corner of the comment text box or see this forum post for in depth instructions on code formatting in the forum

Below is the HTML:

<img src="img/profile pic.jpg" alt="Photo of Katie" class"profile-photo">

And the CSS:

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

3 Answers

Stone Preston
Stone Preston
42,016 Points

here is your issue:

<img src="img/profile pic.jpg" alt="Photo of Katie" class"profile-photo">

you are missing an = sign after the word class. try:

<img src="img/profile pic.jpg" alt="Photo of Katie" class="profile-photo">

Ah, thanks! It works now

Agto Nugroho
Agto Nugroho
3,245 Points

Hi guys, I do this : '''html

    <img src="img/agto.jpg" alt="Photo of Agto" class="profile-photo">

''' my image doesnt appear.

but when I do this :

'''html

    <img src="img/agto.jpg" alt="Photo of Agto" class="profile-photo">
    <img src="img/agto.jpg" alt="Photo of Agto" class="profile-photo">

'''

my image appear ( only one ) like example.

How do I fix it? :D

Thanks!