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: ...

Get Test-Driven JavaScript Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.