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

CSS How to Make a Website Adding Pages to a Website Add Iconography

Chris Huxtalble
Chris Huxtalble
1,514 Points

When I add a margin of 10px on the bottom of the a elements, I don't see an increased space between the lines. Why?

My code is exactly the same as far as I can tell but no matter what margin value I put in, it seems to have no affect on webpage. Not sure what's going on.

Hi Chris,

Can you post that portion of your css?

2 Answers

Austin Whipple
Austin Whipple
29,725 Points

It would be helpful to see the code, but I suspect it's due to the fact that <a> elements are, by default, inline elements rather than block-level elements. This produces strange or no results when trying to apply top and bottom margins and other properties.

Try this and see how it goes:

a {
   display: block;
   margin-bottom: 10px; 
}

More information on block vs. inline elements.

I had this same problem, turns out I was missing a ':' after margin thus the code was ignored completely.