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

Why is "display: block;" making the profile picture disappear? My code is exactly the same as the demonstration.

In the middle of the "How To Make a Website" course.

We'll need to see your code to help figure out what might be happening to cause this behavior.

The easiest way to share your code is to take a snapshot of your current workspace. This is the camera icon in the top right. You can then post a link to the snapshot to share your current version with us.

Otherwise, you can also post your code on the forums by hand. You can paste it in between lines of three back ticks (```) in order to preserve formatting and syntax highlighting.

2 Answers

It looks like it's being displaced by your float. It's not 'disappearing' so much as being displaced off-screen to the right. If you scroll to the right you should be able to see it.

// Add the following line to your .portfolio-photo styles and see if that fixes it.
.profile-photo {
  display: block;
  clear: both; // <-- This line here is the new one. <--
  max-width: 150px;
  margin: 0 auto 30px;
  border-radius: 100%;
}
// This will stop the float from interfering with it's positioning.

Floats can cause some tricky problems sometimes when it comes to layouts. Unfortunately, they're sometimes the best solution (currently) for certain designs.

That worked, thank you!

Here is my workspace snapshot.

https://w.trhou.se/sxpn7zy9u2