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

Martina Vonkomerova
Martina Vonkomerova
7,790 Points

Why cant I center Profile Image in my about page? (Mozilla)

I added the following code in main.css file: .profile-photo { clear: both; display: block; max-width: 150px; margin: 0 auto 30px; border-radius: 100%; } And my html is looking like this: <section> <img src="imgs/BrunoES.jpg" alt="Photograph of Bruno Santos" class="profile-photo"> <h3>About</h3> <p> Introdution about my self. Mention github </p> </section>

Finally, my image size is : 200px X 200px

5 Answers

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

Looks like an error in your text, you have typed imgs/ instead of img/ might be that.

Tim Knight
Tim Knight
28,888 Points

Martina,

From what I can tell your profile image is centering with the example code that you provided.

See: http://codepen.io/timknight/pen/aOZWJG?editors=110

Having the same problem in mozilla. I am guessing it has to do with the browser.

Tim Knight
Tim Knight
28,888 Points

What version of Firefox are you able to repeat this on James?

It's the newest version of firefox. I found the answer in another comment on the video. There is a bug in firefox and you need to add a "clear: both; " to the .profile-photo css .

Eric Ash
Eric Ash
8,122 Points

does anyone know why we need to add clear:both. just curious to the reason behind it