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.

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.
Take a look at the demo page.
RELATED POSTS:
Create custom file chosen input type using Css and Jquery
Facebook Style Textarea Auto Grow Using JQuery Plugin and Css
Change the colored image into black and white image on image hover
Marquee style in different manner with PHP and MySql
My Demos page design details with all my tutorials
Change background image while page refresh using Javascript
RELATED POSTS:
Create custom file chosen input type using Css and Jquery
Facebook Style Textarea Auto Grow Using JQuery Plugin and Css
Change the colored image into black and white image on image hover
Marquee style in different manner with PHP and MySql
My Demos page design details with all my tutorials
Change background image while page refresh using Javascript
No comments:
Post a Comment