我试图将选择框的第一个选项加粗,但它只适用于 Firefox,不适用于其他浏览器(Chrome、IE)。这是我试过的代码。
HTML
<select id="htmldisabled">
<option class="bold">test1</option>
<option>test2</option>
<option>test3</option>
<option>test4</option>
<option>test5</option>
<option>test6</option>
</select>
CSS
.bold {
font-weight:bold;
}
参见 jsfiddle 的演示.
最佳答案
#htmldisabled:first-child{
font-weight:bold;
}
关于html - 如何在所有浏览器中加粗选择的第一个选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8356797/