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

Tim Hyson
Tim Hyson
7,942 Points

Profile pic

Hi,

I'm enjoying following your 'How to Make a Website' tutorial, but I've hit a snag in the 'Style New pages' chapter and can't spot where I've gone wrong.

When I apply CSS to the .profile-photo, the image moves to the top right corner of the browser window, alongside the header. All of the other .profile-photo CSS seems to transfer correctly, and if I comment out display: block; the image displays above the <p> text, but aligned left.

I haven't used this discussion feature before, please let me know what other information you need in able to help me find where I've gone wrong!

Many thanks,

Tim

Tim Hyson
Tim Hyson
7,942 Points

A bit of reading around in the forum has pointed me to the Teachers Notes section, which answers my query:

"There's a bug in the CSS for this video that causes the profile picture to display incorrectly in Firefox. In order to correct the issue, the clear property with the value both needs to be applied to the .profile-photo class. Here's what the corrected code looks like:

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

Thanks to anyone who has shed light on this!

2 Answers

you need to get rid of clear

should be

.profile-photo {
  display: block;
  max-width: 150px;
  margin: 0 auto 30px;
  border-radius: 100%;
-moz-border-radius: 100%;
}
Tim Hyson
Tim Hyson
7,942 Points

Hi Elijah

Thanks for your post.

The CSS line clear: both; is the workaround posted by treehouse tutors to resolve the issue - adding this into my css allowed my image to display as I intended in Firefox.

I notice you've added the line -moz-border-radius: 100%; which presumably has the same effect? Forgive my ignorance but I'm keen to learn - what exactly is the issue with Firefox and how does this line solve it? Are there other Mozilla display issues I should be aware of when writing css?

No problems Tim Hyson I'm still learning myself. I added the -moz-border-radius because I had seen you added border-radius. The older versions of FF needs the webkit as well as Opera Safaria and IE