Contact Us or call 1-877-932-8228


HTML5 is the latest revision of the web markup language standard - it addresses the shortcomings of HTML 4 and XHTML, and also adds new features. Adoption of HTML5 depends, of course, on the degree to which browsers support HTML5 features. Luckily for us, support - especially for the features we'll focus on here - is especially strong among mobile browsers.

HTML5 is in part an acceptance of the fact that browsers tolerate lots of bad code, that perhaps we need not be so strict with requiring end tags and case sensitivity, and that making obsolete some ten years' worth of existing web pages would be catastrophic.

As an example of this flexibility, all of the following are permitted in HTML5:

  1. <link type="text/css" href="style.css" />
  2. <LINK TYPE="text/css" HREF="style.css" />
  3. <link type=text/css href=style.css>
  4. <LINK TYPE=text/css HREF=style.css>
  5. <LiNk TyPe=text/css hReF="style.css">

As the above shows:

  1. HTML5 is case insensitive.
  2. HTML5 allows for unclosed tags, but you can use the XML-style shortcut close tag if you want, as shown in the first two examples above.
  3. HTML5 does not require quotes around attribute values unless the values have spaces in them - <div class="news featured">, for example.

This new flexibility could lead to a bit of chaos on your development team. Different HTML authors will take different approaches. Our recommendation is that you choose one approach and stick to it. In this course, for example, we use the following guidelines:

  1. Write tags and attributes in all lowercase letters (even event handlers like onclick).
  2. Do not use shortcut close tags for void/empty elements.
  3. Put all attribute values in quotes. (Why? Because attribute values that have spaces in them have to be in quotes. And I do not like the idea of having some attributes in quotes and some not.)
  4. Minimize attributes when you can.

Of course, your choices here must also take into account your expected audience's use of older browsers - a self-closed div, for instance, won't work in Internet Explorer 7 and 8.