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

HTML How to Make a Website Adding Pages to a Website Style New Pages

Sam Donald
Sam Donald
36,305 Points

Positioning profile-photo

my positioning isn't working correctly. my code currently looks like this:

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

Display, Border-radius and Max-width all work fine, but the ing is resting to the left of the screen with no spacing between the h3 heading or the navigation menu.

Any ideas? Thanks,
Sam
Sam Donald
Sam Donald
36,305 Points

Ok that's weird I refreshed for like the 100th time and now it is centred but still no spacing between the img and the navigation. The spacing between the navigation and my gallery on the Portfolio page is less then Nicks as well. maybe the issue is the nav, I'll check that out.

Sam Donald
Sam Donald
36,305 Points

Ok so I left the .profile-photo code as is and went to the header. I changed the header margin from 0 30px 0 0 to 0 30px 25px 0 and that seems to have given me what I needed for the profile image and the gallery. Let me know if you think this solution is right or if you think it will give me problems when building the site out for larger devices.

Thanks,

2 Answers

Lori Brandimarte
Lori Brandimarte
10,848 Points

My header margin is

margin: 0 0 30px 0;

from what you typed in your second comment, it looks like you had the 30px margin in the header set for left instead of bottom.

Sam Donald
Sam Donald
36,305 Points

Ah, thanks Brandimarte, I knew it made no sense for my code to look so completely different to Nicks. I made the changes and it's looking good!

Thanks!

Lori Brandimarte
Lori Brandimarte
10,848 Points

Your welcome! I help when I can =)