Last Updated: February 25, 2016
·
613
· precise54

Default anchor styles

I used to write a base style for anchors

a {
  text-decoration: underline;
  color: #aaaaaa;
}

And then override any special cases. But since I started using a tags forblock-level links (think tiles), I'm finding it better to approach it with the following method:

a {
    text-decoration: none;
    color: inherit;
}
p a {
    text-decoration: underline;
    color: #aaaaaa;
}

Alternatively, use a reset class on links that you don't want to be styled e.g.

a {
    text-decoration: underline;
    color: #aaaaaa;
}
a.r {
    text-decoration: none;
    color: inherit;
}

Let me know if you think this is useful!