From our sponsor: Ready to show your plugin skills? Enter the Penpot Plugins Contest (Nov 15-Dec 15) to win cash prizes!
So you’re still not using HTML5, huh? I guess you probably have your reasons; it’s not fully adopted yet, it doesn’t work in IE, you don’t like users, you’re out of touch or you are just passionately in love with writing strict XHTML code. HTML5 is the revolution that the web needed and the fact is, it is the future whether you like it or not — suck it up and deal. HTML5 isn’t hard to use or understand and even though it’s not fully adopted yet, there are still plenty of reasons to start using it right now — like right after you get done reading this article.
There are lots of articles touting the use of HTML5 and praising the benefits of it, yes this is another one of those. With all these articles, with Apple pushing it, with Adobe building new dev products around it, and with so many web sites devoted to it, I still talk to fellow designers and developers who haven’t or won’t adopt it for a variety of reasons. I think the main problem is, it still seems like a mysterious creature to many. To many it feels more like the jet pack or the flying car — an awesome idea that is fun to think about but still not practical in its use. Wrong, the reality is that it is extremely practical right now! It’s not the latest Mercedes concept car being towed around form car show to car show, it’s a reality and it’s not going anywhere.
In order to further demystify HTML5 and help these knuckle dragging designers and developers to jump on the bandwagon I’ve put together a top ten list of reasons why we should all be using HTML5 right now. For those that currently use HTML5 this list may not be anything new or ground breaking, but hopefully it will inspire you to share the benefits of HTML5 with others in the community. We’ll do this Letterman countdown style (minus the celebrity presenter) and start with number ten – accessibility.
Tiny break: 📬 Want to stay up to date with frontend and trends in web design? Subscribe and get our Collective newsletter twice a tweek.
10 – Accessibility
HTML5 makes creating accessible sites easier for two main reasons: semantics and ARIA. The new (some currently available) HTML headings like <header>, <footer>, <nav>, <section>, <aside>, etc. allow screen readers to easily access content. Before, your screen readers had no way to determine what a given <div> was even if you assigned it an ID or Class. With new semantic tags screen readers can better examine the HTML document and create a better experience for those who use them.
ARIA is a W3C spec that is mainly used to assign specific “roles” to elements in an HTML document – essentially creating important landmarks on the page: header, footer, navigation or article, via role attributes. This has been well overlooked and widely under-used mostly due to the fact that it wasn’t valid, however, HTML5 will validate these attributes. Also, HTML5 will have built in roles that can’t be over-ridden making assigning roles a no brainer. For a more in depth discussion on HTML5 and ARIA please visit the WAI.
9 – Video and Audio Support
Forget about Flash Player and other third party media players, make your videos and audio truly accessible with the new HTML5 <video> and <audio> tags. Getting your media to play correctly has always been pretty much a nightmare, you had to use the <embed> and <object> tags and assign a huge list of parameters just to get the thing visible and working correctly. Your media tags just become these nasty, huge chunks of confusing code segments. HTML5’s video and audio tags basically treat them as images; <video src=”url”/>. But what about all those parameters like height, width and autoplay? No worries my good man, just define those attributes in the tag just like any other HTML element: <video src=”url” width=”640px” height=”380px” autoplay/>.
It’s actually that dead simple, however because old evil browsers out there don’t like our HTML5 friend, you’ll need to add a little bit more code to get them working correctly… but this code isn’t nearly as gnarly and messy as the <object> and <embed> tags:
<video poster="myvideo.jpg" controls> <source src="myvideo.m4v" type="video/mp4" /> <source src="myvideo.ogg" type="video/ogg" /> <embed src="/to/my/video/player"></embed> </video>
Some resources worth checking out:
- HTML5 Audio and Video: What you Must Know
- Audio and Video processing
in HTML5 - How to Make Your Own Video Player On HTML5 Video
- Using HTML5 Video and Audio in Modern Browsers
- Browserscene: Creating a 3D sound visualiser with WebGL and HTML5 audio
8 – Doctype
<!DOCTYPE html>
Yup that’s it, that is the doctype, nothing more, nothing less. Pretty simple right? No more cutting and pasting some long unreadable line of code and no more dirty head tags filled with doctype attributes. You can simply and easily type it out and be happy. The really great thing about it though, beyond the simplicity, is that it works in every browser clear back to the dreaded IE6.
7 – Cleaner Code
If you are passionate about simple, elegant, easy to read code then HTML5 is the beast for you. HTML5 allows you to write clear and descriptive code, semantic code that allows you to easily separate meaning from style and content. Consider this typical and simple header code with navigation:
<div id="header"> <h1>Header Text</h1> <div id="nav"> <ul> <li><a href="#">Link</a></li> <li><a href="#">Link</a></li> <li><a href="#">Link</a></li> </ul> </div> </div>
So this code is pretty clean and simple? But with HTML5 you can clean this up even more and at the same time give your markup more meaning:
<header> <h1>Header Text</h1> <nav> <ul> <li><a href="#">Link</a></li> <li><a href="#">Link</a></li> <li><a href="#">Link</a></li> </ul> </nav> </header>
With HTML5 you can finally cure your “divitis” and “classitis” by using semantic and HTML headers to describe your content. Previously you would generally just use div’s for every block of content than drop an id or class on it to describe its content but with the new <section>, <article>, <header>, <footer>, <aside> and <nav> tags, HTML5 allows you to code your markup cleaner as well as keep your CSS better organized and happier.
Some resources worth checking out:
6 – Smarter Storage
One of the coolest things about HTML5 is the new local storage feature. It’s a little bit of a cross between regular old cookies and a client-side database. It’s better than cookies because it allows for storage across multiple windows, it has better security and performance and data will persist even after the browser is closed. Because it’s essentially a client side data base you don’t have to worry about the user deleting cookies and it is been adopted by all the popular browsers.
Local storage is great for many things, but it’s one of HTML5 tools that are making web apps possible without third party plugins. Being able to store data in the user’s browser allows you to easily create those app features like: storing user information, the ability to cache data, and the ability to load the user’s previous application state. If you are interested in getting started with local storage, check out Christian Heilmann’s great 24 Ways article from last year — Wrapping Things Nicely with HTML5 Local Storage.
Some more resources worth checking out:
- Storing Data the Simple HTML5 Way (and a few tricks you might not have known)
- Quick Tip: Learning About HTML5 Local Storage
- HTML5 Local Storage
- 5 Obscure Facts About HTML5 LocalStorage
5 – Better Interactions
Awe, we all want better interactions, we all want a more dynamic website that responds to the user and allows the user to enjoy/interact your content instead of just look at it. Enter <canvas>, the drawing HTML5 tag that allows you to do most (if not more) interactive and animated possibilities than the previous rich internet application platforms like Flash.
Beyond <canvas>, HTML5 also comes with a slew of great APIs that allow you to build a better user experience and a beefier, more dynamic web application — here’s a quick list of native APIs:
- Drag and Drop (DnD)
- Offline storage database
- Browser history management
- document editing
- Timed media playback
For way more info on these APIs and more native interactive features of HTML5 visit HTML5Doctor.
Some resources worth checking out:
- Hakim’s experiments
- Ricardo’s works
- HTML5 Canvas and Audio Experiment
- Ball Pool
- HTML5 Video Destruction
- Social Weather Mapping
4 – Game Development
Yup, that is correct, you can develop games using HTML5’s <canvas> tag. HTML5 provides a great, mobile friendly way to develop fun, interactive games. If you’ve built Flash games before, you’ll love building HTML5 games.
Script-Tutorials has recently offered a four part series of lessons focused on HTML5 game development, head on over and check out some of the sick stuff they have created:
- HTML5 Gaming Development Lesson One
- HTML5 Gaming Development Lesson Two
- HTML5 Gaming Development Lesson Three
- HTML5 Gaming Development Lesson Four
Some more resources worth checking out:
- How to Build Asteroids with the Impact HTML5 Game Engine
- Developing Multiplayer HTML5 Games with Node.js
- How to write a BrikBloc game with HTML5 SVG and Canvas
- How to make a simple HTML5 Canvas game
- Html5 Games
- LimeJS, an HTML5 game framework
3 – Legacy/Cross Browser Support
Your modern, popular browsers all support HTML5 (Chrome, Firefox, Safari IE9 and Opera) and the HTML5 doctype was created so that all browsers, even the really old and annoying ones, er, IE6 can use it. But just because old browsers recognize the doctype that doesn’t mean they can use all the new HTML5 tags and goodies. Fortunately, HTML5 is being built to make things easier and more cross browser friendly so in those older IE browsers that don’t like the new tags we can just simply add a Javascript shiv that will allow them to use the new elements:
<!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]-->
Some resources worth checking out:
2 – Mobile, Mobile, Mobile
Call it a hunch, but I think mobile technology is becoming more popular these days. I know, that is a pretty crazy assumption and some of your are probably thinking — mobile is just a fad… right. Mobile devices are taking over the world. The adoption of mobile devices continues to grow very rapidly and this means that more and more users will be using their mobile browsers to view your web site or application. HTML5 is the most mobile ready tool for developing mobile sites and apps. With Adobe announcing the death of mobile Flash, you will now count on HTML5 to do your mobile web application development.
Mobile browsers have fully adopted HTML5 so creating mobile ready projects is as easy as designing and constructing for their smaller touch screen displays — hence the popularity of Responsive Design. There are some great meta tags that also allow you to optimize for mobile:
- Viewport: allows you to define viewport widths and zoom settings
- Full screen browsing: IOS specific values that allow Apple devices to display in full screen mode
- Home Screen Icons: like favicons on desktop, these icons are used to add favorites to the home screen of an IOS and Android mobile device
For more info on how to mobilize your site via HTML5, check out “Mobifying” Your HTML5 Site.
Some resources worth checking out:
1 – It’s the Future, Get With It!
The number one reason why you should start using HTML5 today is this: it’s the future, start using it now so you don’t get left behind. HTML5 is not going anywhere and as more and more elements get adopted more and more companies will start to develop in HTML5. HTML5 is essentially just HTML, it’s not scary, it’s not anything you really need to figure out or relearn — if you’re developing XHTML strict right now you are already developing in HTML5 so why not take full advantage of it’s current capability?
You really don’t have any excuses not to adopt HTML5 and begin your new love affair with it. Truly, the only real reason I prefer to use HTML5 is just to write cleaner code, all the other benefits and fun features I haven’t even really jumped into yet, but that is the great thing about it, you can just start using it right now and not even change the way you design. So, start using it right now, whether you are just simplifying and making your markup more semantic OR you are gonna build some sick new mobile game that will take over the world — who knows, maybe you can start selling stuffed animal versions of your gaming characters too.
Patrick, super great article and we are quite frustrated that Codrops itself is not on the bandwagon yet (it’s like 10 years back) 🙂 but we are working on it!
Cheers, ML
This is an excellent article. I’ve been loving HTML5, but was unaware of Drag and Drop features until now. Makes an upcoming project that much easier.
Agree ! Awesome Article 🙂
HTML5 is quite intriguing too.
I have always the same criticism about HTML5, because there is still no standard in the web browsers, many things doesn’t work in all web browsers, something is good in Firefox doesn’t work in IE, for example the question is, When??
Main reason – SEO!!!!
Search engines can better determine the purpose of a page, and even more so with schema.org microdata included in the markup.
The rest of it’s fluff!
HTML5 FTW!!! – no more words!
Well that put things into perspective. Time to make the switch!
Thanks !!
Many thanks for this
Exactly, everyone should adopt it and move things forward and accept graceful browser degradation for older non-compliant browsers…
Only problem here is that your site won’t work when you have JS turned off in IE8 and below, so if you have a site that’s visited by people in China… probably not a good idea to use HTML5 (currently there is still 30% IE6 market share in China).
Also I question the accessibility part. I’ve been told that you need to have the site working without JS in order to be WCAG 2.0 Level A
Thanks patrick. excellent article
“3 – Legacy/Cross Browser Support” – unfortunately, the level of HTML5 support is different for different browsers as yet (both desktop and mobile ones). This may be a problem for some target audiences (see more on http://www.htmlcut.com/blog/cross-browser-psd-to-html-conversion.html ). However, the browser manufacturers work hard now trying to provide increasingly better HTML5/CSS3 support, and surely it’s very stimulating for web designers and developers.
I think it’s time for me to start using it too. Thanks for good article 🙂
Great article. I already use HTML5, but I have this next project and local storage is the PERFECT answer to my prayers 🙂
Many many thanks!!!
Ya that was the question for all y should i use HTML5? i think this is the answer but still some of them won’t use as they follow some versions of IE.
The big question is how you deal with browser incompatibility .
Daniel Piechnick
Awesome..Thanks a lot
Great article! I would like to add something about the nav element.
Your code:
// code removed
The nav element automatically positions child anchors inline. So there’s no reason to use an unordered list.
So here’s your code even cleaner:
// code removed
//Your comment was edited because it contained HTML, please use pre if you’d like to add code
Great article! I personally can’t see any reasons why people wouldn’t want to make the switch to HTML5 right now! The pro’s far outweigh the con’s and there are many huge benefits.
Personally I love the simplified tags – etc. This makes it very easy to create clean semantic code, and also helps if more than one person is required to work on a website.
Some great reasons there. I’ll get on it right away 🙂
html5 is semantical rubbish. those developers need to be shot. it’s like you would begin to speak esperanto nowadays. it could work, some will understand it. but there are no rules for it and that sucks!
XHTML2 would be a great future. but this time the w3c failed like this article 🙁 sorry
and those html5 media objects do me fuck off. no individual streaming technologie. the user has no option to choose.
it’s enough. i don’t see any good in html5 but SEO.
best regards 🙂
Great article – nice work; some great related links too.
Nice ideas. What a shame this site is stuck with XHTML Transitional!
Bullshit and more bullshit.
Though it’s about time W3 rewrote some seriously wrongs about HTML, it’s gotten worse in certain aspects.
Do we really need half-a-million different types of tags?
Once upon a time, we used the extremely ugly two tags to embed a video through flash.
Now, it’s 5 tags. Hooray!
Loads of more experimental API to play with, some of which fails more than it works on MODERN browsers.
But it’s ok to have a JS library for file uploads, DnD (we need to bridge those browsers, no?), video, legacy/nc-browsers…etc etc.
Wonderful new future: code more or else you’re “old”!
A year ago I developed my first game with canvas, kind of left this stuff behind, wish I continued improving, I’d be awesome by now.
I don’t have a full on HTML5 yet because many of my customers don’t know anything outside the IE world, so it’s not a good business tactic to tell them to piss off as soon as they go in your site…
Trouble is, I want as many people to see my site as possbile, in the best and most consistent way. So until more ‘old’ browsers die I can’t really justify using HTML5.
I don’t not use it cos I’m behind the times or lazy, I don’t use it cos I have clients and businesses that can’t always keep up with the latest thing.
To many sites look rubbish because devs are using HTML5 assuming that everyone else can.
your clients don’t care what coding standard you use.
Your visitors don’t care what you use. if they do, it’s because they’re in the industry you are in and you told them to look.
I say, use what you need to get on with it and less procrastinating.
I really think that we don’t learn from what we lived before.. we don’t remember the compatibility issues between browsers and the level of support of HTML4 and older versions?? Are we don’t remember the nightmares to make compatible a web app between browsers? This is going to change with HTML5? How? When? For now the specification is incomplete, maybe in another 5 years is going to be done. Ok there is going to be HTML5 in every mobile device, with what level of compatibility? Depending of the browser, manufacturer, OS Type, OS Version?
I think that this is going to be a bigger mess and a bigger nightmare for us, the developers. A better solution I think that it was Flash and Silverlight… but shortly I’m wrong because Adobe and MS look like are going to support this big mess better than support his own platforms… please tell me why I’m wrong.
HTML5 cannot come soon enough! There are a lot of things to learn, and one person will not be able to master all of them.
Great article!
Idunno … given all the browser differences and such, I prefer to stay on a CMS or a web dev framework which abstracts the differences between browsers, supports an acceptably larte number of browsers, and lets me do my work without even touching HTML. This way, I don’t really care about HTML anymore.
Most of my customers are approaching the use of tablets and mobile devices, and the solution is obviously html5!
HTML5 is still too new. The standards are not widely and consistently adopted across browsers. This leads to too many fallbacks and work arounds in the underlying Javascript code. You also have IP issues with embedded mp4 videos with certain modern browsers. Flash comes to the rescue, so Flash is relevant and useful.
HTML5 for mobile is only useful if you DON’T have embedded videos. If you do, then writing a local app for the device is still the way to go. Offline HTML5 storage (both manifest and database) don’t work well with videos. Manifest doesn’t support video files, and web databases are only 50 megabytes by domain, which isn’t enough.
The main overriding factor for NOT using HTML5 to write your business application is that all your code is in Javascript. Talk about giving your proprietary code away for free. It doesn’t take much to figure out the code, especially when compared to Silverlight & Flash.
That’s one heck of a business model!
If there was an underlying coding environment for HTML5 that’s more like Flash or Silverlight where you can compile your code and/or obfuscate it, then I’d endorse HTML5.
Thanks for all the great comments, it’s great to here all sides of the HTML5 debate.
The end game for HTML5 is a user friendly, better indexed, fully compatible experience for all. Which is why Adobe, MS and Apple are all supportive. While it’s true that HTML5 is incomplete and some issues still remain, it’s never to early to start approaching our projects in this new meaningful way.
In some cases it may not be useful or beneficial and it’s no biggie if your not using it, but HTML5 is coming and I believe now is the time to use it, learn it, get comfortable with it and experiment with it.
html5 is AWESOME
You forgot BEACAUSE IT ROCKS !!!
I attempted to write a little bit about this but I didn’t want to really push people to use it because I wasn’t sure if it was time yet. I see I’m not the only one in support!
Nice article… but it’s “shim”, not “shiv”… look it up, that’s quite an entertaining typo 🙂
thanks for demystifying html5, i was wondering what all the fuss is about, now im excited about it
Fantastic,
Just few weeks ago I started converting to html5 and as you mentioned you can see the advantage of just using html5 for the basic layout, compared to XHTML it is a lot more cleaner and therefore easier to debug, to find where the elements start and end
After finishing the layouts I started and fully get my head around dos and donts of simple layouts, I will definitely start playing around with storage and the canvas features
Great article
Great article!
Just reading into HTML5 and this article helped me a lot to understand more about it’s features. Thanks!
I already started implementing most of the HTML5 tags. A tag which I don’t really understand though is the Tag. alone would have been enough in my opinion.
A few things not quite correct in this article, e.g. ‘With Adobe announcing the death of mobile Flash, you will now count on HTML5 to do your mobile web application development.’ That’s Flash for the mobile browser! Adobe are really pushing Flex and Air for mobile development, so Flash for mobile application development is most definitely still alive. I’m not knocking the article but it is a very simplified view and in reality isn’t that clear cut from experience in the html5 and Flash world. Would be good to see an article with the opposite argument to run parallel with this one.
HYML 5 is the best.
God bless you html5 evangelists. You are well meaning and pushing this forward so that eventually we can all take advantage of these new APIs and hopefully, code once – deploy everywhere. However we are not there yet and your article is not realistic.
Please spend 5 minutes with JAWS 12 screen reading technology and let us know how well those HTML5 tags improve behavior. Oh yah, make sure you are using IE9 with media elements. And then in two years try it with JAWS 13. And one more thing, do it on an enterprise level commercial website supporting 99% of the user base.
Again, I envy your enthusiasm, just keep it real. HTML5 adoption will grow, but is not as ubiquitous as this article makes it out to be. It is imperfect at best, and is not a cover-all solution unless you are ready to limit your audience and pretend that microsoft, mozilla, apple and adobe don’t exist.
Please do use what you can, but don’t fool yourself into thinking it will be any less work.
groso !
@RICK you are Right, but please dont be lured by rumours that says MS is going to kill SL. They are not correct. Who would want to write 100 000 of javascript and worry about malformed tags. i go for Silverlight
Hey great list thanks for putting this together and posting… love your site btw.
~Jim
nice article, for wordpress user there are many framework for building html5 ready themes
Given that from a recent poll of 6000+ users from a clients website 11% are still using IE6, 3% are using mobile devices and a mere 28% are using non Microsoft browsers, the huge majority of web users can’t enjoy the same experience that those in the design industry do. I can’t afford (and neither can my clients) to shift an entire system that works for all to one that’s going to be better (yet hobbled) for a vast minority.
It’s all a very nice idea and for the tech savvy and those who are in control of their browsing experience it’s great – but those people are not your typical web users.
Great article Patrick! After reading this, plan to move towards HTML5 for my next project.