简体   繁体   中英

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). This is the code I have and I tested it in IE7 (which doesn't support outset) and Opera 11 (which supports outset). 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.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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