在Firefox和IE中,我应该使用什么CSS来获取选项标签的边框? [英] What CSS should I use to get a border around an option tag in both Firefox and IE?
问题描述
现在我使用以下CSS:
Right now I am using the following CSS:
option
{
border-width: 1px;
border-style: solid;
}
在Firefox中可以正常工作,我不确定它是否有所作为,但是选项标签是由ASP.NET ListBox控件生成的。
Which works fine in Firefox but not in IE. I'm not sure if it makes a difference but the option tags are generated by an ASP.NET ListBox control.
推荐答案
,选项
元素的样式由不同的浏览器在不同程度上支持。 Firefox是唯一允许您在选项
和
Unfortunately, the styling of option
elements is supported to different degrees by different browsers. Firefox is the only browser which allows you to add a border around option
s – IE and Chrome won't show a border.
这里是不同浏览器支持什么样式的概述。您可以可靠地应用的样式是背景和前景色。
Here's an overview of what styles different browsers support. The only styling you can reliably apply is background and foreground color.
这篇关于在Firefox和IE中,我应该使用什么CSS来获取选项标签的边框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!