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

Pamela Browne
Pamela Browne
7,332 Points

I'm going crazy trying to figure out why the profile-photo CSS is not being applied!

And I used the same CSS code to pass the code challenge! Anyone see what I'm missing? Thanks!

From about.html page:

<img src="img/nick.jpg" alt="Photograph of Nick Pettit" class="profile-photo">

From main.css:

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

5 Answers

Pavle Lucic
Pavle Lucic
10,801 Points

If you are using firefox add just 1 more property to the .profile-photo

clear:both;

Pamela Browne
Pamela Browne
7,332 Points

Thanks. I'm using Chrome. The was issue resolved when I logged back in the next day, so I thought it was just a matter of restarting Workspaces. A similar display issue happened in a later step, so I tried restarting Workspaces and Chrome. That didn't work but I decided to wait and see how it looked the next day. Again the display issue resolved on its own.

Pavle Lucic
Pavle Lucic
10,801 Points

Maybe the cache is the problem.

My advice is to use refreshing pages (ctrl + f5). You will also delete cache on particular page.

Pamela Browne
Pamela Browne
7,332 Points

Good point. I forget to try that option.

Pamela Browne
Pamela Browne
7,332 Points

I think the answer turned out to be "try restarting Workspaces" because I haven't done anything and it is working now! Thanks anyway :)

Alexander Costa
Alexander Costa
11,464 Points

Looks like your in an HTML sheet! wrap your CSS markup with the <style> tag

or add it to the external stylesheet

Pamela Browne
Pamela Browne
7,332 Points

Sorry to confuse, I just pasted parts of the code from to different files.

David Perkins
David Perkins
9,607 Points

Make sure you've closed your img element in the HTML.

<img src="img/nick.jpg" alt="Photograph of Nick Pettit" class="profile-photo" />
Bryce Chua
Bryce Chua
5,429 Points

Hi Pamela, tried your method of restarting the workspaces in chrome and it works fine now!