在Firefox和IE中,我应该使用什么CSS来获取选项标签的边框? [英] What CSS should I use to get a border around an option tag in both Firefox and IE?

查看:136
本文介绍了在Firefox和IE中,我应该使用什么CSS来获取选项标签的边框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我使用以下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是唯一允许您在选项之间添加边框的浏览器; IE和Chrome不会显示边框。

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 options – 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屋!

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