bozdoz
bozdoz

Reputation: 12860

Why is there a margin on these links? CSS

Here's the JSFiddle: http://jsfiddle.net/bozdoz/k2enx/

Margin for #topLinks a is set to 0, so I don't see why there is a space between the links. I set the background to red so you can see the margins.

enter image description here

I would like to remove the blue vertical lines in between the anchor elements. I have done this before, but I can't seem to get it to work in this circumstance for some reason. Any suggestions?

Upvotes: 1

Views: 57

Answers (1)

JJJ
JJJ

Reputation: 33163

It's not margin, its a space. As the links are inline elements any whitespace between them is converted into a single space. Remove newlines from between the links:

<a href="#">Home</a><a href="#">Profession</a><a href="#">about</a>

Upvotes: 3

Related Questions