daily gadgets, computers, and electronic news
14/05
2005

Use CSS to Change Highlighted Text Style

Sponsored Links

There are several interesting style on Mozilla’s specific CSS. One of the most interesting trick is changing the style of the text when user highlighted the text using -moz-selection property. Look below:

[css]::-moz-selection{
background-color: #ff0000;
color: #fff;
}[/css]

now when user selected or highlighted any text, the background color will change to red (#ff0000) and the text color is white (#fff). I used that style on this site so simply highlighted any text here and see the result :) )

Don’t forget that this is Mozilla’s specific CSS, so it won’t work on Internet Explorer. I hope this property will be included on CSS3 specification draft so more browser will support it.
Use CSS to Change Highlighted Text Style is written by cosa and posted under Web & Graphic Design , , , . If you like it, you might consider subscribing to our feed, follows us on Twitter, or receive our latest posts via email. Or else, you could also or store it to your favourite social bookmark sites. Further information about this article can be found.
And while you're here, why don't you check out our other articles:

4 Comments »

No comments yet.

Leave a comment