Three ways to use Modernizr

In the CSS:


.no-cssgradients .header {
  background: url("images/gradient.png");
}
.cssgradients .header {
  background-image: linear-gradient(blue, purple);
}

As a JavaScript object:


if (Modernizr.csstransforms) {
    newBrowsersDoThis();
  } else {
    oldBrowsersDoThis();
  }

Check for HTML element class:


 
// Modernizr adds the feature detected 
Read more

HTML5 localStorage

As an exercise, I wanted to use vanilla javascript and localStorage() to take two items from the input fields, store them in localStorage, then get those stored items and place them as values back into the inputs. Finally clearing all … Read more