Click to See Complete Forum and Search --> : change text color on selection


gemguy
08-22-2007, 02:52 AM
Hi,

I need some css tips on how to change the text color alone but not the background color when a selection is made.

i had used the below code which works well and specific for mozilla which changes the background to red and text to white on selecting the text.

*::-moz-selection {
background-color:#FF3C00;
}


But i need to change the text color alone something like blue.... Is there any CSS code to do it.

tobbilla78
08-22-2007, 03:20 AM
Sorry i have no idea.

------------------------------
In this case just shut up. And don't insert commercial links in or as your signature, otherwise next time you will be baned.

Signature links deleted by:
Kor - SuperMod

Kor
08-22-2007, 04:44 AM
use the color CSS attribute:

*::-moz-selection {
color:#0000cc;
}

gemguy
08-22-2007, 11:51 PM
Hi,

Its specific on mozilla and also i like to have the solution on all cross browser selections.

Kravvitz
08-23-2007, 12:08 AM
IE doesn't support this at all and Opera doesn't support it yet.

Safari 1.2+ supports ::selection.

So use this:
*::-moz-selection, *::selection {
color:#0000cc;
}