Change text & background color while selecting text using CSS3
2my4edge is Loading.. Wait
FOLLOW ME :

Sunday, July 14, 2013

Change text & background color while selecting text using CSS3

Change text color and background color while you are selecting text for copy or any other purpose, make your web page impressive with extra design using this css selection text color change, getting bored of usual selecting color on your web page, so try this code. While selecting content of any web page that selected with the default color of blue, so change it with this css.

DOWNLOAD                      LIVE DEMO

While trying to copy any content from any site, we have to select some text using mouse, while selecting those time the default design will come with the blue, for that we are changing the selecting color text and background using very simple coding in css3. Let see the coding.

CSS

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

And the above coding for change the color of text change while you are selecting a text.

CSS

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

The above code is for change the background color of selecting text.

And we can make it for a particular area too. Like just call the class/id or tag name before the ::selection that will take for the particular area.

CSS

div  ::selection { background-color:#E2254B;}
div ::-moz-selection { background-color:#E2254B;}

and this code doesnot support with IE-9, it support only IE9+, and for Mozilla firefox need the –moz-selection for make it support in it.