Internet Explorer 中粗体的样式选项 [英] Styling options in bold in Internet Explorer

查看:33
本文介绍了Internet Explorer 中粗体的样式选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了选项的样式问题.我需要一些选项以粗体显示,但 Internet Explorer 不想呈现它.

I am getting a styling problem with options. I need some options to appear in bold style, but Internet Explorer doesn't want to render it.

我正在使用 CSS 进行设置:

I'm setting it using CSS:

font-weight: bold;

这是行不通的.可以在此页面中看到一个示例:

Which is not working. An example can be seen in this page:

示例

在 Firefox 中显示粗体,但在 Internet Explorer 中不显示.

which shows bold fonts in Firefox but not in Internet Explorer.

我在 Internet Explorer 7 和 8 中尝试过.

I have tried in Internet Explorer 7 and 8.

有没有人有其他选择?

示例:

HTML:

<select>
    <option class="special">Special</option>
</select>

CSS:

.special {
    font-weight: bold;
}

推荐答案

IE 不允许 元素独立的样式.这是因为 IE 使用 Windows 窗体控件来呈现选择框,不支持此功能.

IE doesn't allow styling of <option> elements independently. This is because IE uses a Windows form control to render the select box, which doesn't support this feature.

(顺便说一句,这与 IE 的选择框在将它们放在其他对象后面时可能会出现分层问题的原因相同;表单控件由 Windows 操作系统呈现,而不是由浏览器呈现,因此浏览器具有与页面上的大多数其他元素相比,对它的控制更少)

(as an aside, this is the same reason that IE's select boxes can have issues with layering when you put them behind other objects; the form control is being rendered by the Windows OS, not by the browser, so the browser has less control over it than most other elements on the page)

其他现代浏览器确实允许您这样做,因为它们呈现自己的选择框而不是遵从操作系统.

Other modern browsers do allow you to do it, as they render their own select boxes rather than deferring to the OS.

这篇关于Internet Explorer 中粗体的样式选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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