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

Following the tutorial but my code is not producing the same results?

I am following stage 7 of Front-end web development, adding pages to a website with Nick Pettit. I am at the stage where Nick is showing us how to give an image rounded corners using css. I have followed the code he has shown to the letter. However, when I preview it the image disappears.

Here is my image code from the html page:

'''html <img src="img/nick.jpg" alt="Not a photo of Simon Fieldstead" class="profile-photo"> '''

and here is my code from the main css file:

'''css .profile-photo { display: block; max-width: 150px; margin: 0 auto 30px; border-radius: 100%; } ''' through a process of elimination I have found that when I remove

'''css display: block; '''

The image appears and it disappears when I add it back in.

Can someone help me understand what I am doing wrong?


3 Answers

If you're on firefox then you should notice that you have a horizontal scrollbar and if you scroll to the right you should see your image at the top right of your screen. It doesn't really disappear. It has to do with the header being floated.

There's a fix for firefox in the Teacher's Notes.

However, I recommend that you clear the float in the wrapper element instead because that's the first element that comes after the header. This will solve other problems as well.

Add to your existing wrapper rule:

#wrapper {
clear: both;

Then you don't have to clear the float in .profile-photo

Post back here if you weren't on firefox and this is a different problem.

Luke Buśk
Luke Buśk
21,598 Points

Hi Simon,

It would be most efficient if You could paste Your code with codepen and link us to it --> http://codepen.io/.

Alternatively You could make a screenshot of the code.

Firstly, thank you to Luke and Jason for responding so quickly.

Jason, your fix was really helpful thank you.