When you select text in a webpage, the background gets a default blue color. What exact color code does this blue color have?
The ::selection CSS pseudo-element applies rules to the portion of a document that has been highlighted (e.g., selected with the mouse or another pointing device) by the user.
The default depends on the browser you are using. It's usually somewhere around #3297fd
.
You can change it like so:
/* draw any selected text yellow on red background */
::-moz-selection { color: gold; background: red; }
::selection { color: gold; background: red; }
/* draw selected text in a paragraph white on black */
p::-moz-selection { color: white; background: black; }
p::selection { color: white; background: black; }
The selection background colour? That doesn't really have anything to do with the browser, it's an OS setting (and is generally customizable). If you really want to know the specific blue on your machine, screen cap it and open it in any graphics program that lets you inspect colour.
#B4D5FE
#ACCEF7
#B4D5FF
#3297FD
#3399FF
#3298FD
#3399FF
*Found using ColorSnapper for Mac +Found using ColorSchemer for Windows
And here's a screenshot of that information with the hex color codes highlighted in the same color:
This will be a never ending list, however, since each...
...will have a different color. Also, as of CSS3, you can change the color using:
::selection{
background-color:#000;
}