Credit: Topic Simple - What is HTML5? They do cool animated videos.
Welcome to Envato Tuts+! This tutorial provides an introductory overview of HTML5. If you've not heard much about it or just want to understand its relevance, you've come to the right place.
HTML5 is the latest standard for browsers to display and interact with web pages. Approved in 2014, it's the first update to HTML in 14 years. In this day and age, that's a lifetime between updates.
The purpose of HTML5 is primarily to make it easier for web developers and browser creators to follow consensus-based standards that make compliance more efficient and empowering. It's also designed to provide better, faster, more consistent user experiences for desktop and mobile visitors.
Here are a few key improvements in HTML5:
For example, below is an HTML5 geolocation example from Building Your Startup With PHP: Geolocation and Google Places (Tuts+):
HTML5 will improve speed, ease of use and consistency across the web. Yes, your YouTube experience will gradually become consistently wonderful. There will be fewer browser and plugin updates, fewer security threats, and more elegant, more readable, faster websites.
HTML5 makes your life incredibly easier and greatly expands what's possible. It also means you'll be able to build stuff and rely more on the browser builders to assure consistency. This means a lot less conditional layout code.
On one hand, you'll have a great roadmap in the HTML5 specification detailing how and what you should build. On the other hand, there's more to do and get right. It won't be as easy to differentiate your browser vs. the big girl browser manufacturers.
Just a quick reminder before we dive in! I do try to participate in the discussions below. If you have a question or topic suggestion for a future tutorial, please post a comment below or contact me on Twitter @reifman.
HTML5 is the latest in over 20 years of browser programming standards since the launch of the web in 1991.
HTML first emerged as a standard in 1993, and here's the timeline of HTML versions accepted by standards committees:
According to Wikipedia, HTML5 is intended to consolidate earlier versions and differentiated document types such as XHTML 1 and DOM Level 2 HTML:
[HTML5] extends, improves and rationalizes the markup available for documents, and introduces markup and ...(APIs) for complex web applications...HTML5 is also a potential candidate for cross-platform mobile applications. Many features have been designed with low-powered devices such as smartphones and tablets taken in to consideration.
Here's a summary of how MakeUseOf explained HTML5's goals:
Image credit: Topic Simple
A lot, it turns out! HTML5 provides such an impressive list of new capabilities that the major browsers are still not fully compliant even 18 months after its acceptance:
Image credit: PHPFlow
There's also this interactive visual rainbow at HTML5Readiness. Hover over different arcs and you'll see which features are supported by which browsers:
It's fun, but other charts at other sites may be more functionally intuitive to use.
In 2011, Wikipedia reported about one third of the top 100 Web sites supported some HTML5. By August 2013, about 153 of the Fortune 500 websites did.
Here's a visualization of the vastness of HTML5's capabilities:
Image credit: Wikipedia
The most basic new elements of HTML5 make it easier to lay out web pages and to debug your code or others'. It also makes it easier for automated services to scan the web and understand the importance of different page components.
For page layout and key features, there are now specific elements such as:
Here's a nice visual outline of these by Smashing Magazine:
HTML5 and The Future of the Web offers another guide to these features. Here's one of their takeaways—they very much appreciate the application cache:
Need to see which features are supported in which browsers? HTML5Test has a useful interactive assessment for features and browser support:
There are so many new features that it's impossible to catalog all of them here. Do check the resource links at the bottom of this tutorial for deeper resources that I recommend.
Let's take a look at a few cool examples of HTML5 in action.
The simplicity of HTML5 is clear in its new page layouts. The more content-oriented elements make page code easier to comprehend and debug. Here's a simple example I built with the HTML5-Reset project:
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title></title> <meta name="author" content="" /> <meta name="description" content="" /> <link rel="stylesheet" href="assets/css/style.css" /> <!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> </head> <body> <header> <h1><a href="/">Page Title</a></h1> <nav> <ol> <li><a href="">Nav Link 1</a></li> <li><a href="">Nav Link 2</a></li> <li><a href="">Nav Link 3</a></li> </ol> </nav> </header> <article> <h1>Article Header</h1> <p>Etiam pretium odio eu mi convallis vitae varius neque pharetra. Nulla vestibulum nisi ut sem cursus sed mattis nisi egestas.</p> <h2>Article Subhead</h2> <p>Vestibulum lacus erat, volutpat vel dignissim at, fringilla ut felis.</p> </article> <aside> <h2>Sidebar Content</h2> </aside> <footer> <p><small>© Copyright Your Name Here 2014. All Rights Reserved.</small></p> </footer> </div> <script src="scripts/js/scripts.js"></script> </body> </html>
Notice there's a simpler doctype tag, link tags and script tags. The HTML5Shiv script provides legacy support for versions of Internet Explorer before 9.x.
If you want to see some other approaches, check out the HTML5 Boilerplate, a broader open-source default HTML5 page.
Here's a video example from W3Schools showing source code on the left and the resulting player on the right:
There's no plugin required and no updates.
HTML5 has a wide variety of enhancements to forms and input elements to make web programming easier and the user experience much better. For example, input elements now support a variety of built-in validations. Here's a validation for numbers within a specific range:
Here are a couple of excellent tutorials for going a step deeper on forms at HTML5 Doctor:
For example, here's a demonstration of the range element shown in a Chrome browser:
I hope you've enjoyed this overview of the emergence and benefit of HTML5. If you'd like to explore HTML5 further, there are two more resources I'd like to suggest:
Here's an example of the browsable demos at HTML5 Demos (not all of them worked for me):
If you're a WordPress site manager like many Envato Tuts+ readers, you may want to assess future themes for their compliance with HTML5. Standards-driven development with consistent browser support makes web development much easier for so many of us and will reduce the number of bugs our customers run into while increasingly providing better user experiences.
Overall, I've been quite impressed with HTML5. And it appears it will continue to evolve faster than every 14 years.
Additionally, if you're looking for other utilities to help you grow your HTML5 skills, don't forget to see what we have available in Envato Market.
I'd love to hear more of your feedback about HTML5 and suggestions for future topics you'd like to learn more about. Please feel free to post your questions and comments below. You can also contact me on Twitter @reifman directly. To see other tutorials I've written, browse my Envato Tuts+ instructor page.
Because there are so many useful resources for HTML5, I've included an extra helping of some of those I find most useful: