In this tutorial, I’ll go over two approaches for detecting whether a browser supports certain CSS features or not. The first one takes advantage of Modernizr , a popular JavaScript library and the second one feature queries , a promising CSS solution. So, let’s start! Detecting Features Using Modernizr As mentioned above, Modernizr is a lightweight JavaScript library which detects HTML5 and CSS3 features in your browser. As long as your page loads, it runs behind the scenes and performs feature tests. Then, it stores the results as properties of a JavaScript object and as classes of the html element. More on that later. To install and use Modernizr, you can visit its site and download the preferred version. Note : at the time of writing, Modernizr’s current release is 2.8.3, though version 3 is almost ready.
↧