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

set image to block element

How do I set a block element?

2 Answers

Erik McClintock
Erik McClintock
45,783 Points

Bob,

As you may have seen thus far in your studies, different types of HTML elements have different display types that indicate how they behave and how different properties will affect them and respond to them. In order to alter an element's display property, you simply target it just like you would any other property in CSS:

img {
    display: block;
}

This will target all elements with the tag of img, and will set their display property to block.

Hope this helps to clarify!

Erik