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 trialBrad Lacke
7,438 PointsDisplay property of the .callout links
Am I correct in saying that the main reason for styling the .callout links as "inline-block" elements is so that we can apply the top margin?
2 Answers
Jesus Mendoza
23,289 PointsInline-Block lets you manipulate the container as a Block element, but at the same time it acts like an inline element. The most noticable properties that can be applied to inline-block elements that can't be applied to inline elements can be width, height, margins and paddings.
Sunshine Khawaja
1,845 PointsI think in this example you are exactly right. The margins applied seems to be the only obvious reason for adding the display: inline-block;.
tian jin
Courses Plus Student 5,162 Pointstian jin
Courses Plus Student 5,162 Pointsinline element can be applied with padding, but the padding won't affect other surrounding elements' position.
Jesus Mendoza
23,289 PointsJesus Mendoza
23,289 PointsYeah but the top and bottom padding does not affect inline elements
tian jin
Courses Plus Student 5,162 Pointstian jin
Courses Plus Student 5,162 Pointsfor top margin and bottom margin it doesn't affect, for top padding and bottom padding, it does.