Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fredchu/0a4523166045ccd821e0 to your computer and use it in GitHub Desktop.
Save fredchu/0a4523166045ccd821e0 to your computer and use it in GitHub Desktop.
Overriding The Default Text Selection Color With CSS
/* draw any selected text yellow on red background */
::-moz-selection { color: gold; background: red; }
::selection { color: gold; background: red; }
/* draw selected text in a paragraph white on black */
p::-moz-selection { color: white; background: black; }
p::selection { color: white; background: black; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment