Change Text Selection Color

Fundamental 163 views
0
0 Flares 0 Flares ×

The ::selection selector is supported in IE9+, Opera, Google Chrome and Safari. Firefox supports an alternative, the ::-moz-selection.

::-moz-selection {
	background-color: #dd2020;
	color: #fff;
}

::selection {
	background-color: #dd2020;
	color: #fff;
}

Doesn’t Work

::-moz-selection,
::selection {
	background-color: #dd2020;
	color: #fff;
}

Note that only a few CSS properties can be applied to ::selection: color, background, cursor, and outline.

For Reference:

Text Selection Color

Provided by: Brian Gardner
Posted in CSS

Discuss:

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

No Trackbacks.

Login

Register | Lost your password?
0 Flares Twitter 0 Facebook 0 Google+ 0 0 Flares ×