开发者

CSS3 TextArea Highlight Color

开发者 https://www.devze.com 2023-01-11 18:37 出处:网络
I\'ve been using the following CSS3 option to change the highlight color of text on a webpage. However, the only element on the webpage is a textarea, and the following CSS doesn\'t seem to do anythin

I've been using the following CSS3 option to change the highlight color of text on a webpage. However, the only element on the webpage is a textarea, and the following CSS doesn't seem to do anything.

::selection { background:#B9B9B9; color:#000000; }

Am I doing it wrong?开发者_StackOverflow Is it possible to change the highlight color of a textarea? Or am I just wasting my time?


Try using the vendor extension versions -moz-selection and -webkit-selection:

::selection { background:#B9B9B9; color:#000000; }
::-moz-selection { background:#B9B9B9; color:#000000; }
::-webkit-selection { background:#B9B9B9; color:#000000; }

Note that the selection pseudo has been removed from the current draft.

0

精彩评论

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

关注公众号