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.








Hi Sam Been hunting the internet for some advice on optimum source files for flash - with no joy. But came across your encoding flash video article and have been enlightened. Many thanks Grant
Very helpful information. Much appreciated. Thank you.
Thank you for this useful article.
Very informative.
It solved my issue with horizontal lines in flash video files.