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 trialPrince Karikari
Front End Web Development Techdegree Student 157 PointsDisplay inline
Guil said that top and bottom margins dont affect elements with the display value INLINE. But, the top and bottom margin property works with IMG elements even though their display value is INLINE. Any reason for that?
1 Answer
Daniel Landon Jr
14,733 Points<img>
tags are both. They are referred to as replaced inline element
Unless you float an <img>
tag it will flow with the tet that is around it.
However, it still has properties like a block element such as width and height so it acts like it is inline-block
Hope that helps
Prince Karikari
Front End Web Development Techdegree Student 157 PointsPrince Karikari
Front End Web Development Techdegree Student 157 PointsSure it does. Thanks