O'Reilly logo

Test-Driven JavaScript Development by Harmeet Singh, Hetal Prajapati, Ravi Kumar Gupta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Modernizr methods

Modernizr allows you to extend it by writing more tests and utilizing them to detect features of your choice. Along with that, there are methods available for testing CSS prefixes and media queries.

Modernizr.prefixed()

You might have seen CSS as in the following example:

    -moz-border-radius: 10px 10px;
    -webkit-border-top-left-radius: 10px;
    -webkit-border-top-right-radius: 10px;
    -webkit-border-bottom-right-radius: 10px;
    -webkit-border-bottom-left-radius: 10px;
    border-radius: 10px 10px;

The preceding CSS is to put radius on elements like div and so on. If you note, there are prefixes before border-radius or border-xxx-xxx-radius. These are called vendor or browser prefixes. The following table shows the browsers and their prefixes: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required