Make IE 8,7 and 6 more compliant with CSS3, mediaqueries and HTML5

Do we still care about IE8, 7 and 6? I feel it’s becoming more okay to ignore them now, but IE8 support is still a bit of a should-I-or-should-I-not case.

There are 3 really helpful scripts to load in your theme if you want to support one or more of them. They add better compatibility for “modern” things such as responsive design, CSS pseudo-classes and attribute selectors as well as HTML5 tags.

We load these if we see that the web browser used is older than IE9:

  • html5shiv.js (source) – HTML5 support
  • selectivizr.js (source) – CSS pseudo-class support (eg :last-child)
  • respond.js (source) – mediaquery support

Read more

Using a no-js class in your WordPress theme

The no-js class can often be seen in css and html, normally placed on the html or body tag. What is it all about? It’s to be able to add specific CSS styling for those who view the site with javascript disabled. How does it work? We run a simple javascript that replaces the “no-js” class with “js”. If no javascript is enabled, no-js remains. As simple as that.

Read more