簡體   English   中英

有沒有辦法在 Materializecss Select 中更改文本和箭頭的顏色?

[英]Is there a way to change the color of the text and arrow in a Materializecss Select?

只是想把文本和箭頭變成白色:

在此處輸入圖片說明

這是代碼:

<div class="input-field col s12 white-text">
  <select class="white-text" id="selectSide">
    <option value="All" selected>All</option>
    <option value="Buy">Buy</option>
    <option value="Sell">Sell</option>
  </select>
  <label class="white-text">Side</label>
</div>

應用於輸入、下拉和圖標的實際樣式如下:

對於圖標:

.select-wrapper .caret {

    fill: firebrick;
}

對於下拉內容:

.dropdown-content li span {  
    color: firebrick;   
}

對於選定的項目顏色:

.dropdown-content li span {  
    color: firebrick;   
}

顯然將耐火磚更改為您想要的顏色。 旁注,Materializecss 隱藏了原始的 select 元素並創建了一個帶有內置下拉列表的新元素 - 因此上面的樣式(.dropdown-content 和 .select-wrapper)是動態生成的,因此如果您正在尋找樣式,則有點困難在原始標記處。

工作演示在這里

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

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