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

adriana muga
adriana muga
1,007 Points

CSS: display: block; make my image disappear from the page.

Hello,

When following the "Adding Pages to a website" video I am supposed to write in the CSS document:

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

When I refresh the page the image I am shaping disappears. But if I use the code:

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

Just deleting the display "display: block;" the image appears and all seems to work. I've rewritten it again and again, refreshed, log out and back again... I don't know what I am doing wrong.

Thanks,

4 Answers

On teacher's notes:

Correction for Firefox

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%;
}
adriana muga
adriana muga
1,007 Points

Thanks! It works now!

Christina Hall Are you using Firefox? Read above. If you are Id recommend Chrome. It works well with Treehouse and Workspaces.

Christina Hall Are you using Firefox? Read above. If you are Id recommend Chrome. It works well with Treehouse and Workspaces.