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 Build the Contact Page

Satbir Singh
Satbir Singh
1,674 Points

in about.html page... the image of nick,,, in class profile-photo... with display:block;... the image is disappearing

display block is not working my coding is as under

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

Hi Satbir,

Can you post the code you're having issues with please?

If you add 3 back ticks (```) on the line above and 3 backticks on the line below it should then display as below in the post and help us to identify the problem:

.profile-photo {
   ...styles go here...
}

Thanks

-Rich

4 Answers

Khaleel Hamid
Khaleel Hamid
5,258 Points

Should work like this, but I assume your saying that when you put display: block; it doesn't display image?

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

If you are using Firefox then setting display:block will not work. You will have to add clear:both for it to work.

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

yes, it dosen't display image

Hi Satbir,

Based on the code you have added the style should look as follows:

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

I've added in display: block; just in case it was formatted incorrect but it could be that you have another style overriding it.

Look in your style sheet for display: none or specifically for any img tags which could be overriding the styles.

Thanks

-Rich