Modernizr : Java Glossary



A free Javascript library. The current version is 3.1.0 Last revised/verified: 2015-10-16. You can prune it down to just the features you need. You can also read the uncompressed, commented development version. It it does many different tests on browser capabilities and put a form that you can use them in your CSS (Cascading Style Sheets) style sheets.

Unfortunately there are no detects for brand of browser. I understand purists consider detecting and using the brand of browser wicked. It never occurred to them that if you give instructions on how to use the browser, they depend on the browser and version, not capabilities.

How It Works

The trick to how it works and communicates with CSS is elegant. You load its JavaScript library, by inserting a line like this in the header:

<!-- load modernizr library in the header -->
<script src="modernizr-1.1.js"></script>

and it does various binary tests of capabilities. Then for every capability that exists, it applies a style with the name of that capability to your body tag e.g. .csscolumns. For every capabilitity that does not exist, it applies a style to your body tag with the name of that capability, with the letters no- prefixed, eg. .no-csscolumns. Now, using garden variety CSS, you use these styles in your rules to create variants for when the capability is present or absent. You can use display:none to hide text. In addition it creates a JavaScript object called Modernizer with boolean fields for all the capabilities.

One strategy might be to examine their open source, then write your own JavaScript code monkey-see, monkey-do fashion.

This page is posted
on the web at:

Optional Replicator mirror
on local hard disk J:

Canadian Mind Products
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

Your face IP:[]
You are visitor number