简体   繁体   English

如何检测浏览器是否支持起始边框样式

[英]how to detect whether browser supports outset border style

I'm trying to figure out what browsers are capable of producing button-like boxes (via the outset property). 我试图弄清楚哪些浏览器能够产生类似按钮的框(通过outset属性)。 This is the code I have and I tested it in IE7 (which doesn't support outset) and Opera 11 (which supports outset). 这是我拥有的代码,我在IE7(不支持开始)和Opera 11(支持开始)中对其进行了测试。 Upon running this script, the message that appears is "outset" in both environments. 运行此脚本后,在两种环境中出现的消息都是“开始”。 How can I make it so that I can get a different value if outset is not supported because clearly from IE7's test, the box is solid and not outset as the message box indicated. 我如何做到这一点,以便在不支持起点的情况下获得不同的值,因为从IE7的测试中可以明显看出,该方框是实心的,而不是如消息框所示的起点。

Is there anyway to detect this? 反正有检测到吗?

This is my code: 这是我的代码:

<div ID="X">Test</div>
<script>
var x=document.getElementById("X");
x.style.width='200px';
x.style.height='200px';
x.style.border='2px solid #FF0';
x.style.border='2px outset #000';
alert(x.style.borderStyle);
</script>

猜猜您需要现代化的JavaScript库

mike,you can follow the below plugin for iE 迈克,您可以按照以下iE插件进行操作

http://css3pie.com/demos/border-radius/ http://css3pie.com/demos/border-radius/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM