【发布时间】:2012-09-13 13:43:40
【问题描述】:
可能重复:
Change css font-family for separate options in select tag
Styling options in bold in Internet Explorer
我无法在 IE8,9 中设置 HTML 选择下拉列表的字体系列。 这是错误/属性还是我做错了什么?字体大小设置有效。这个例子太极端了,我真正的问题是我在页面和列表中有不同的字体。
我不关心 IE7-。
示例(http://jsfiddle.net/SDcLX/11/):
我有以下 HTML:
aaaaa
<div class="container">
skjhlks <select>
<option class="courier">courier</option>
<option>aa</option>
<option style="font-family:impact;" selected="selected" >bb</option>
</select>
</div>
和 CSS
.container
{
font-size:30px;
font-family:Lucida Handwriting;
}
select
{
font-family:inherit;
font-size:inherit;
}
option.courier
{
font-family:courier;
}
FF中的结果是:
在 IE 中:
【问题讨论】:
-
至少类似,但没有说明是IE的问题。我的目标是使用与页面其他部分相同的字体,或者声明这是不可能的。
标签: html css internet-explorer drop-down-menu html-select