[英]How to override the default select option css?
在一个表单中,我有两个不同的下拉菜单(一个需要,一个不需要)。
所需的下拉列表 select 具有浅灰色占位符文本颜色,而常规下拉列表 select 具有黑色占位符文本颜色。
我想覆盖黑色占位符颜色以匹配浅灰色。 我似乎无法用!important
在 CSS 中覆盖它
select option:disabled {
color: lighgrey !important;
}
这不起作用,我不确定什么起作用
将颜色放在 select
select:disabled { color: lightgrey;important; }
<select disabled> <option>black</option> <option>green</option> </select>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.