How can I add space between anchor tags?

In CSS the different lengths/sizes need to have specific units, the browser doesn't guess your intent, it simply discards invalid property values, in this case I used px, since I'm assuming that's what you wanted to use:

a {
    line-height: 1em;
    display: inline-block;
    text-decoration: none;
    padding: 120px;
    margin: 42px;
}

JS Fiddle demo.

Alternative units include (but are not limited to): em, rem, ex, pt, cm (among others).

References:

  • CSS Values and Units Module, Distance Units: the <length> type.

<a>1<a/>&nbsp;&nbsp;&nbsp;&nbsp;<a>2<a/>

1    2

non breaking space if you like ..


You need to add the units to your margin and padding e.g.

padding: 120px;
margin: 42px;

Tags:

Html

Css

Anchor