In the shown example, we will have a color change in the text when marked, but only if it is in a SPAN tag. Then the CSS CLASS looks like this:
SPAN::-moz-selection { /* Code for Firefox */
color: green;
background-color: magenta;
}
SPAN::selection {
color: green;
background-color: magenta;
}
The code for the example looks like this:
Here the text is normal, <SPAN>here there is a SPAN,</SPAN> and here the text returns to normal.
On the screen it looks like this, when marking the text:
Here the text is normal, here there is a SPAN, and here the text returns to normal.
Note: ::selection is not supported by Internet Explorer until after ver. 8.