211

I need its code representation, like #FFFFFF.

Wilfred Hughes
  • 29,846
  • 15
  • 139
  • 192
Bill
  • 2,147
  • 2
  • 13
  • 4
  • 5
    In what browser? (There is no defined "standard".) – John Parker Jan 23 '11 at 13:19
  • 8
    The question can be interpreted as relating both the actual browser practice and to recommendations. Especially now that HTML5 is about to standardize the colors (as “expected rendering”), the question is on-topic and should be reopened. Note that the answer with most votes does *not* correspond to current practice and HTML5 CR. – Jukka K. Korpela Jun 27 '13 at 18:42
  • 1
    @Jukka K. Korpela - Note also that "the answer with the most votes" is a moving target. Well intentioned, but please refer to a specific answer. – Nicolas Mar 16 '17 at 18:44

13 Answers13

282

As of HTML5, the foreground colors of hyperlinks, among other things, are on track for standardization in the form of guidelines for expected default rendering behavior. In particular, taken from the section Phrasing content, the recommended default colors for unvisited and visited hyperlinks are the following:

:link { color: #0000EE; }
:visited { color: #551A8B; }

Notice that there is no recommended default for active hyperlinks (:link:active, :visited:active), however.

You can use these default colors and reasonably expect them to work. But keep in mind that a browser is free to ignore any or all of these guidelines, as it is never required to follow them. It is, however, recommended for a consistent user experience across browsers (which is how "expected" is defined in this context), so chances are that these colors will correspond to the defaults for most browsers. At worst, they still serve as reasonable approximations of the actual values.

In particular, the default unvisited and visited link colors in the latest versions of Firefox and Chrome are consistent with the above guidelines, but recent versions of IE report different values: unvisited links are rgb(0, 102, 204), or #0066CC, and visited links are rgb(128, 0, 128), or #800080. Older versions of Firefox (and possibly Safari/Chrome) had different defaults as well. Those are older versions, however; the main outlier today that I am aware of is IE. No word yet on whether this will change in Project Spartan — currently it still reflects the same values as the latest version of IE.

If you are looking for a standardized color scheme that is used by all browsers rather than suggested by HTML5, then there isn't one. Neither is there a way to revert to a browser's default value for a particular property on a particular element using pure CSS. You will have to either use the colors suggested by HTML5, or devise your own color scheme and use that instead. Either of these options will take precedence over a browser's defaults, regardless of browser.

If in doubt, you can always use the about:blank technique I described before to sniff out the default colors, as it remains applicable today. You can use this to sniff the active link color in all browsers, for example; in the latest version of Firefox (29 as of this update), it's rgb(238, 0, 0), or #EE0000.

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
  • Thank you, but is there some average code for mozilla, safari, ie, chrome? not just default "blue"? I need all links styles (visited, hovered) to be default styled.. – Bill Jan 23 '11 at 13:29
102
  • standard link - #0000FF //blue
  • visited link - #800080 //purple
  • active link - #FF0000 //red

that was a standard but heavily differs per browser now. (since Nielsen gave it up ;)

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
Caspar Kleijne
  • 21,552
  • 13
  • 72
  • 102
  • 21
    I'm not sure why 66 people just took this answer's word for it. Even if the values did come from a standard, for which this answer provides no sources whatsoever, that standard would have long been obsolete anyway as this answer implies, and using it in new code would be meaningless. – BoltClock May 04 '14 at 13:25
  • @stom: That looks like it should be a separate answer instead. Even if you meant for it to be a source link, it's not a valid source since none of the three values here appear there. – BoltClock Jul 11 '15 at 18:28
20

The default colours in Gecko, assuming the user hasn't changed their preferences, are:

  • standard link: #0000EE (blue)
  • visited link: #551A8B (purple)
  • active link: #EE0000 (red)

Source

Gecko also provides names for the user's colours; they are -moz-hyperlinktext -moz-visitedhyperlinktext and -moz-activehyperlinktext and they also provide -moz-nativehyperlinktext which is the system link colour.

Zombo
  • 1
  • 62
  • 391
  • 407
Neil
  • 54,642
  • 8
  • 60
  • 72
6

I am used to Chrome's color so the blue color in Chrome for link is #007bff

grandia
  • 709
  • 7
  • 20
5

Use the revert css keyword.

a {
    color: revert;
}

For uBlock Origin htmlgiant.com##a:style(color:revert !important;)

perplexed
  • 63
  • 1
  • 6
4

According to the official default HTML stylesheet, there is no defined default link color. However, you can find out the default your browser uses by either taking a screenshot and using the pipette tool in any decent graphic editor or using the developer tools of your browser (select an a element, look for computed values>color).

phihag
  • 278,196
  • 72
  • 453
  • 469
3

For me, on Chrome (updated June 2018) the color for an unvisited link is #2779F6. You can always get this by zooming in really close, taking a screenshot, and visiting a website like html-color-codes.info that will convert a screenshot to a color code.

3

Visited - #660199 Visited - #660199

Unvisited - #1a0dab Unvisited - #1a0dab

Cole Henrich
  • 155
  • 3
  • 17
1

Entirely depends on the website you are visiting, and in absence of an overwrite on the website, on the browser. There is no standard for that.

Femaref
  • 60,705
  • 7
  • 138
  • 176
0

In CSS you can use the color string currentColor inside a link to eg make the border the same color as your default link color:

.example {
    border: 1px solid currentColor;
}
Dominik
  • 6,078
  • 8
  • 37
  • 61
0

The best way to get a browser's default styling on something is to not style the element at all in the first place.

jeffszusz
  • 435
  • 2
  • 7
  • 3
    The problem is that sometimes the styling comes from a library. We just noticed that jQuery UI's default stylesheet contains `.ui-widget-content a { color: black; }`, so any links in tabs lose their normal coloring. I'd like to override that and just get the browser's default colors (or the user's personal stylesheet), but instead I'll have to hard-code specific colors. – Barmar Sep 07 '12 at 22:43
  • 3
    Another moment when you may want to know the RGB values is if you want to include graphics which matches the color of the links – marcelnijman Jul 06 '13 at 20:30
0

Default html color code like this:

Red      #FF0000  rgb(255, 0, 0)
Maroon   #800000  rgb(128, 0, 0)
Yellow   #FFFF00  rgb(255, 255, 0)
Olive    #808000  rgb(128, 128, 0)
Blue     #0000FF  rgb(0, 0, 255)
Navy     #000080  rgb(0, 0, 128)
Fuchsia  #FF00FF  rgb(255, 0, 255)
Purple   #800080  rgb(128, 0, 128)
light
  • 4,157
  • 3
  • 25
  • 38
R. Kumar
  • 11
  • 1
0

For Google chrome currently, it is #0070E0 or rgb(0, 112, 224).

desertnaut
  • 57,590
  • 26
  • 140
  • 166
Dipesh
  • 3
  • 2