Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS

mrx3
mrx3
8,742 Points

Having some trouble with adding some space between my a href tags. Any help would be appreciated. (codepen included).

I'm just practicing making a float based layout. I have a section of code floated to the left, with the heading "various links." These links point to various teachers twitter accounts on teamtreehouse. The problem I'm having is that I can't add any "Whitespace" to the bottom of the links with css. I would be nice to give these links some "breathing space. I've tried attribute selectors but, nothing seems to work. Can any one help me figure out how to add some space to the bottom of the a href tags using css? The class name is floatLeft, and it starts on line 84 of my css Codepen. Thank you in advance for any help.

Codepen Link: http://codepen.io/mike316/pen/XJeLxB

2 Answers

kevin jordan
kevin jordan
11,353 Points

Mr X: Here's a forked pen of your code : http://codepen.io/anon/pen/WbZqmO

Basically I added all your a href s into an UL - like you did in your nav class. Then I used css to remove the styling from the LI.

Hope this helps ! kj

mrx3
mrx3
8,742 Points

Thank you kj.

Richard Ling
Richard Ling
8,522 Points

Hi,

Have attached another codepen link: http://codepen.io/anon/pen/JorQwz

It's not particularly elegant (it's late, and I'm tired haha), but it works. I've wrapped your links in a container with class leftLinks, then added css to turn the inner a tags into block level elements. From there you can just adjust the bottom margin as required. I've also removed the br tags as they're no longer necessary.

Hope that moves you in the direction you were after! :)

Thanks, Rich

mrx3
mrx3
8,742 Points

Thank you Richard.