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 or receive our latest posts via email. Or else, you could also bookmark it to your favourite social bookmark sites. Further information about this article can be found .

4 Comments (leave yours)

No comments yet.

We are pleased to offer you this exciting, new, and entirely free professional resource. Visit our Free Industry resource center today to browse our selection of 600+ complimentary Industry magazines, white papers, webinars, podcasts, and more. Get popular titles including:

Website Magazine
Oracle Magazine
Customer Relationship Management: Secrets to CRM Success

No credit cards, coupons, or promo codes required. Try it today!

Leave a comment