CSS - wordpress如何改变下拉元素的字体样式
CSS - wordpress how to change the drop down element's font style
我正在尝试更改所有下拉列表中元素的字体。我想保留下拉列表标题的字体,但更改其中元素的字体。我在 wordpress 中使用 present,所以我从 google devtool 中获取了 class 代码,但我尝试编写 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;
}
我正在尝试按照附图做一些事情。
例子
在此先感谢大家
您需要链接 CSS 选择器,例如:
option.attached.enabled {
font-family: Montserrat;
font-weight: 700;
}
https://jsfiddle.net/39gd2mtq/
您当前拥有的 (option.attached enabled
) 正在 option.attached
.
中寻找名为 enabled
的子元素
我正在尝试更改所有下拉列表中元素的字体。我想保留下拉列表标题的字体,但更改其中元素的字体。我在 wordpress 中使用 present,所以我从 google devtool 中获取了 class 代码,但我尝试编写 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;
}
我正在尝试按照附图做一些事情。
例子
在此先感谢大家
您需要链接 CSS 选择器,例如:
option.attached.enabled {
font-family: Montserrat;
font-weight: 700;
}
https://jsfiddle.net/39gd2mtq/
您当前拥有的 (option.attached enabled
) 正在 option.attached
.
enabled
的子元素