簡體   English   中英

如何覆蓋默認的 select 選項 css?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM