Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

css link color styles best practice

There are many css-samples for styling color of links.

html5boilerplate.com offers such css code for link:

a { color: #00e; } a:visited { color: #551a8b; } a:hover { color: #06e; }​ 

Is it good enough for most cases?

Or maybe better css-code exist for styling color of links?

like image 539
webvitaly Avatar asked Aug 14 '12 15:08

webvitaly


People also ask

What is the best color for links?

Shades of blue provide the strongest signal for links, but other colors work almost as well. As always, when using color to signal information, you should provide redundant cues for color-blind users. Making unvisited links brighter and more luminous than visited links will usually accomplish this goal.

What is the standard color for links?

There has been a long path of visual elements used to denote hyperlinks, and the color blue is just one of many elements that have come to represent a hyperlink.


1 Answers

That's definitely will suffice in vast majority of cases.

Just keep in mind that the correct order of styles for links is:

a:link           { color: #c00 }  /* unvisited links       */ a:visited        { color: #0c0 }  /* visited links         */ a:hover, a:focus { color: #00c }  /* user hovers, or focus */ a:active         { color: #ccc }  /* active links          */ 

The outline might look "ugly" for you, but that's a very important accessibility feature. If you remove that - please take care of providing an alternative way to properly distinguish the current element (bigger/bolder font, high contrast background etc.)

like image 174
Zoltan Toth Avatar answered Sep 20 '22 08:09

Zoltan Toth