开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜