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

Mir K
Mir K
2,388 Points

Display: block?

Once I set my profile picture to display: block; it goes next the header part of the page and I have to scroll over to see it. This is fixed when I take away this setting. I'm not sure what I'm doing wrong. Everything else looks the same.

3 Answers

A block element fills the entire width of its parent, so the reason I can think of for that happening is that it (or its parent) is floated.

EDIT: or one of its parents has been set to display: inline; or display: inline-block;

Yep. I was having the same problem, until I added "clear: both;" as the first declaration in the .profile-photo class rule. Once I added that, it showed up with no problem.

Mir K
Mir K
2,388 Points

Thank you, this fixed it

Kevin Sackeli
Kevin Sackeli
4,723 Points

I had the same problem. I added clear: both and it worked. Thanks for the help