如何将不同的样式应用于HTML中选择标签的选项 [英] How to apply different styles to options of select tag in HTML

查看:89
本文介绍了如何将不同的样式应用于HTML中选择标签的选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在下拉选项上应用一些CSS类。 CSS在Firefox中正确应用,但在IE(7,8)中,只有颜色被应用。任何机构都可以告诉我如何在IE 7和IE 8的下拉选项上应用样式。

  .regionOption {
font-weight:bold;
}

.countryOption {
margin-left:10px;
padding-left:5px;
}

根据条件,我在选项上使用这些CSS类。他们在Firefox中工作得很好。



我想显示区域和国家之间的区别,有没有其他方法?

感谢
Ashwani

解决方案

目前支持选项元素的全部样式。



支持样式的完整列表出现在以下MSDN文章标题为样式的部分中:



http ://msdn.microsoft.com/en-us/library/ms535877%28VS.85%29.aspx


I am trying to apply some CSS class on the options of a drop down. The CSS apply correctly in Firefox, but in IE (7, 8) only color is getting applied. Can any body tell me how to apply styles on options of drop down for IE 7 and IE 8.

 .regionOption {
    font-weight: bold; 
 }

 .countryOption {
    margin-left: 10px;
    padding-left:5px;
 }

I am using these CSS classes on options depending upon conditions. They work fine in Firefox.

I want to show difference between Region and country, is there any other way?

Thanks Ashwani

解决方案

Internet Explorer does not currently support the full range of styles on option elements.

The full list of supported styles appears on the following MSDN article under the section titled "Styles":

http://msdn.microsoft.com/en-us/library/ms535877%28VS.85%29.aspx

这篇关于如何将不同的样式应用于HTML中选择标签的选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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