CSS3 TextArea突出显示颜色 [英] CSS3 TextArea Highlight Color

查看:149
本文介绍了CSS3 TextArea突出显示颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用以下CSS3选项来更改网页上文字的突出显示颜色。但是,网页上唯一的元素是textarea,而下面的CSS似乎没有做任何事情。

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; }

我做错了吗?是否可以更改textarea的高亮颜色?

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

推荐答案

尝试使用供应商扩充功能版本 -moz-selection -webkit-selection

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; }

注意,选择pseudo已经从当前草稿中删除

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

这篇关于CSS3 TextArea突出显示颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆