我正在嘗試更改所有下拉串列中元素的字體。我想保留下拉串列標題的字體,但更改其中元素的字體。我在 wordpress 中使用禮物,所以我從 google devtool 獲取了類代碼,但我嘗試撰寫 css 。我無法更改 html 代碼,因為是預設。
<select id="pa_mat" class=""
name="attribute_pa_mat"
data-attribute_name="attribute_pa_mat"
data-show_option_none="yes">
<option value="">Elige una opción</option>
<option value="foam" class="attached enabled">FOAM</option>
<option value="pvc" class="attached enabled">PVC</option></select>
css
option.attached enabled{
font-family: Montserrat;
font-weight: 700;
}
我正在嘗試做一些如圖所示的事情。
例子

提前感謝大家
uj5u.com熱心網友回復:
您需要鏈接 CSS 選擇器,例如:
option.attached.enabled {
font-family: Montserrat;
font-weight: 700;
}
https://jsfiddle.net/39gd2mtq/
您目前擁有的 ( option.attached enabled) 正在尋找一個名為enabledinside的子元素option.attached。
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/385216.html
標籤:html css WordPress的 求购 前端
