Style highlighted / selected text - CSS Tutorial
Ever wondered how to change the default style of highlighted or selected text in your html page? I have found that this is possible using CSS3, although IE has no support for this so it doesn't work at all in IE.
In this example the background is set to green and the text set to white. Drag over this text to highlight it.
Here's the CSS:
/* Safari */ ::selection { background: #000000; color: #ffffff; } /* Firefox */ ::-moz-selection { background: #000000; color: #ffffff; }
::selection is supported by the latest versions of Opera and Firefox 2 and upwards. ::-moz-selection is supported by the latest versions of Safari.






Thanks for the tip. That's been a peeve of mine for some time!
Thanks! That worked like a breeze
Cascading Style Sheets (CSS) web design lessons
Css link Properties Attributes - examles
http://css-lessons.ucoz.com/link-css-examples-1.htm
http://css-lessons.ucoz.com/link-css-examples-2.htm