如何在 IE 中的 HTML 选择下拉列表中设置字体系列? [英] How to set font-family in HTML select dropdown list in IE?

查看:29
本文介绍了如何在 IE 中的 HTML 选择下拉列表中设置字体系列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<块引用>

可能的重复:

显然 IE 使用操作系统来呈现控件.

也许您可以使用 js 小部件代替 这个它需要一个基本的选择,但用 jquery 转换它.

Possible Duplicate:
Change css font-family for separate options in select tag
Styling options in bold in Internet Explorer

I am not able to set font-family of a dropdown list of HTML select in IE8,9. Is it a bug/property or am I doing something wrong? Font-size setting works. The example is too extreme my real problem is that I have different font on the page and in the list.
I don't care about IE7-.

Example( http://jsfiddle.net/SDcLX/11/):

I have following 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>

and CSS

.container
  {
    font-size:30px;
    font-family:Lucida Handwriting;
   }
select
{
    font-family:inherit;
    font-size:inherit;
}

option.courier
 {
    font-family:courier;
 }

The result in FF is:

and in IE:

解决方案

The question is also a duplicate of styling options in bold in internet explorer

Apparently IE uses the operationg system to render the controls.

Perhaps you can use a js widget instead like this one It takes a basic select but transorms it with jquery.

这篇关于如何在 IE 中的 HTML 选择下拉列表中设置字体系列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆