Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.