Methods to detect whether a user's browser supports CSS3

Source: Internet
Author: User
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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.