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

Having trouble setting img display to block in the quiz.

In the follow along portion we simply did .profile-photo { display: block; } in the css document. In the quiz we are told to input it into the html file and I'm wondering if my location is effecting the answer acceptance or if I'm doing something incorrectly.

can you post what html are you adding inbetween the section tags?

<div id="wrapper"> <section> <img src="img/gratt.png" alt="gratt" class="profile-photo"> <p>Text about myself goes here!</p> .profile-photo { display: block; } </section> <footer> <a href="http://twitter.com/nickrp"><img src="img/twitter-wrap.png" alt="Twitter Logo" class="social-icon"></a> <a href="http://facebook.com/nickpettit"><img src="img/facebook-wrap.png" alt="Facebook Logo" class="social-icon"></a> <p>© 2014 Nick Pettit.</p> </footer> </div>

3 Answers

Ah I see, so for this portion of the challenge they only want you to add the proper image tag with the class, alternate text and source path to the html file. The styling should already be in the css file and not in the html.

 <section>
        <img class="profile-photo" src="img/gratt.png" alt="this is a picture of gratt.">
 </section>

That was the step I did before what I am having trouble with. They then asked me to select the image and set it do be a block element. Maybe I'm temporarily mixing up terminology?

Ah im sorry you're on task 3/5. Okay so you want to add the style inline into the img tag

<img style="display: block;" class="profile-photo" src="img/gratt.png" alt="this is a picture of gratt.">

Aha! Great! Thank you so much! Much confusion(:

No problem glad you were able to figure it out. One thing you can also do is instead of adding the attriubutes inline, you can place it into your main.css file:

img {
  display: block;
}

That way you can just keep this in your section:

<img class="profile-photo" src="img/gratt.png" alt="description">