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 Make an About Page

Select the image and set it to be a block element.

i need help

Stone Preston
Stone Preston
42,016 Points

can you post the code youve tried so far? you will have to format it using markdown. see this post for info on how to do that

10 Answers

Dave McFarland
STAFF
Dave McFarland
Treehouse Teacher

Leah Miller

You need to add this

img {
 display: block; 
}

to the main.css file.

thanks mate :DD

Landon S
Landon S
3,433 Points

What Dave said above me is a good template for the answer. The "img" that he writes is where you will fill in the respective images class name.

img{

display:block;

}

Since we are directed to name the image's class "profile-photo" we must use that class name as the selector for the display property.

.profile-photo{

display:block;

}
display:block
}

hope this helps,sweet pea! <3

that does not help sweet pea, hmph!

Only this does not work as a correct answer on the code challenge

I had the same problem as others described. The code provided above is correct-- don't forget to paste it in the CSS file. I was mistakenly pasting it in the HTML file.

-Annalee

Megan Nelson
Megan Nelson
819 Points

i did the same thing. thanks for pointing this out. (I didn't scroll up, and thought the CSS file disappeared).

thanks Annalee.

Dave McFarland
STAFF
Dave McFarland
Treehouse Teacher

In CSS, you can create a selector to select the image tag like this:

img {

}

To make an element display as a block-level element use the display property:

display: block;

img { display: block }

Shawn Piers
Shawn Piers
2,373 Points

!!!!! I have spent at least an hour trying to figure out how to make this work in the HTML, including nesting it in a <div> element, adding <style> etc within the page. I guess because I have to access the challenges through a VPN the pages are many times not so responsive. I JUST FOUND OUT THERE IS A CSS PAGE AVAILABLE :'(

ac n bv
ac n bv
Courses Plus Student 1,813 Points

yes, thank you for making me aware of that

Thanks to Analee!

.profile-photo{ display:block; } the profile-photo class is the image class created in previous exercise where you had to declare Nick's image as class profile-photo.