This article mainly describes the detection of user browser support CSS3 method, has a certain reference value, now share to everyone, the need for friends can refer to
How to detect whether a user's browser supports CSS3, we need to use HTML,CSS and JavaScript to do this. Here are the steps.
How to detect whether a user's browser supports CSS3, we need to use HTML,CSS and JavaScript to do this. Here are the steps.
1) First make the following HTML
<span id= "Check" rel= "Detect" ></span>
2) then write the following CSS
#check {display:none; width:0; height:0;} #check [rel^= "D"] {display:block; width:0; height:0;}
3) Here is the JavaScripts test script
Make sure that the following code is placed in the HTML file header.
<script. Type= "Text/javascript" > var obj = document.getElementById ("check"); var file= "Special.css"; if (window.getComputedStyle) var stat = window.getComputedStyle (obj,null). GetPropertyValue ("display"); else if (obj.currentstyle) var stat = Obj.currentStyle.display; var CSS3 = (Stat = = "block"); if (CSS3) alert ("CSS3 supported."); else alert ("CSS3 not supported."); </script>
The above is the whole content of this article, I hope that everyone's learning has helped, more relevant content please pay attention to topic.alibabacloud.com!