Modernizr – get fine grained control over your CSS

Modern web browsers like Safari, Chrome and Firefox support some extremely useful parts of the CSS3 specification, that can remove a great deal of the pain of creating simple things like rounded corners, drop shadows, and gradients. However, the elephant in the room is still Internet Explorer, and particularly that god-awful aberration called IE6. So how can you easily take advantage of these new CSS attributes in browsers that support it, but without interfering with legacy browsers like IE?

Modernizr is a lightweight JavaScrpt library that identifies those CSS attributes that the client’s browser supports, then makes those easy to access by adding their names as CSS classes to the <html> tag, or as object properties in JavaScript. This means you can easily create CSS rules that are only used by supported browsers or make decisions within JavaScript to conditionally do things.

.borderradius ul li a { //do stuff}

if(Modernizr.fontface == false) {do stuff};

This entry was posted in Web Development and tagged , , . Bookmark the permalink.

Comments

Awwww. No one's left a comment yet. Why don't you start things off?

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Get Email Alerts

Signup to receive occasional emails with news that may be of interest. Your details will never be disclosed to 3rd parties.




* = required field
I'm interested in...