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 trialBob Potter
879 PointsHow do you select the image and set it to be a block element?
I've tried to select the image in the css file and do a 'display: block;' But that doesn't seem to work.
Julie Myers
7,627 PointsMake sure it looks like this:
img {
display: block;
}
If you already have the above, then it could be you may have forgotten to link your css file in your html file. Or there is a spelling or syntax error in your link element.
3 Answers
alessandradaudt
14,500 PointsWhat if you use the img's class name instead of "img" on your main css file?
Angela Visnesky
20,927 Pointssection img {
display: block;
}
Shannon Ybarra
1,319 PointsHmmmmm..... I've tried both of these and they don't seem to work.
huckleberry
14,636 Pointshuckleberry
14,636 PointsSetting an img tag to block should work as you mentioned. Could you show your code exactly as you have it? (both html and css please.)
Thanks
Cheers,
Huck -