Styling text selection colours

October 29th, 2005

I just discovered that you can style the user’s text selection using CSS 3. At the moment it only works in Gecko and Safari - Safari supports it through the official ::selection whilst Mozilla supports it through the proprietary ::-moz-selection rule. I used the following two rules to change the selection colours:

::-moz-selection { color: black; background: #A0B7CC; }
::selection { color: black; background: #A0B7CC; }

There was no real good reason for doing it apart from that it looks hip. Accidently discovered at moo.fx, more info at Quirks Mode.

  • Uncategorized
  • Comments(3)

Related Posts

  1. Apache Multiview Support Added
  2. PHP: Determining if a server/domain/IP is internal
  3. HTML DOM Visualizer
  4. document.getElementsByClassName compatibility
  5. CSS Architecture

3 Responses to “Styling text selection colours”

  1. Nolion 29 Oct 2005 at 2:02 pm

    It might look ok on a white background, but not on this awful dull blue background. :/

  2. Khloon 29 Oct 2005 at 3:47 pm

    Changed to purple background & white text.

  3. Beckyon 07 Feb 2007 at 9:56 pm

     

    I cant seem to get any other font colours for my msn messenger. i’ve gone to all difffernt sites to look for other colours apart from the standard colours you get with the messenging service. please can u tell me where to get them from.

Trackback URI | Comments RSS

Leave a Reply