::selection

by @jehiah on 2005-10-27 17:46
Filed under: All, CSS

I thought I knew CSS, then I found the ::selection css selector. I picked up on it because I like to click on everything, and click on everything is what I did

Head over to http://moofx.mad4milk.net/ and highlight text on the page to see the effect.

Or just highlight some text on this page, and of course check out quirksmode.org for the explanation of the ::-moz-selection property.

::selection is part of the CSS level 3 specification

[css]
::-moz-selection{
    background:#d4f699;
    color:#7aa62f;
}
::selection{
    background:#d4f699;
    color:#7aa62f;
}
[/css]

Oh, and good luck with that in IE

Subscribe via RSS ı Email
© 2017 - Jehiah Czebotar