how to color background of selected text?
This CSS:
::selection{background:#fffada;color:#fff;}
::-moz-selection{background:#fffada;color:#fff;}
Works fine in Firefox and Safari.
But in or开发者_StackOverflow社区der to do the same thing in Chrome, what do we need to use?
The three you should need to implement are ::selection
, ::-moz-selection
and ::-webkit-selection
. ::selection
should work fine in the latest Webkit browsers though, including Chrome.
See http://www.quirksmode.org/css/selection.html
精彩评论