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!

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

Alison Hjul
Alison Hjul
2,355 Points

Can't center photo on About page

I've entered the code as instructed under the Page: About comment (ie, display: block; max-width: 150px; margin: 0 auto 30px; border-radius: 20px) but the photo won't center - it stays aligned left. Any idea where I could be going wrong? The border-radius code works fine.

2 Answers

Hi Allison,

Would like to see your actual code because mine works.


Alison Hjul
Alison Hjul
2,355 Points

Hi Jeff, Thanks for getting back to me. My CSS code for the photo is:

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

I use Safari browser (v 5.1.10) on a Mac. I've since tried this out in Google Chrome and it centers OK, so it seems to be a browser issue. But it would be good to get this working in Safari too: I'll check if there's a newer version available.