I remember, back in school, every so often our super-mean (but actually very good) math teacher would be away. The class would breathe a collective sigh of relief as, rather than "Mr. Mean" (names have been changed to protect the innocent), the replacement teacher was usually an easy-going and amiable man. He sat quietly and left us to get on without shouting or constant needling. He didn't insist on silence whilst we worked, he didn't much care if we adhered to the way he worked out problems, all that mattered was the answers and that we could articulate how we came to them. If HTML5 were a math teacher, it would be that easy-going supply teacher. I'll now qualify this bizarre analogy.
If you pay attention to how you write code, you'll typically use lower-case for the most part, wrap attribute values in quotation marks, and declare a "type" for scripts and style sheets. For example, perhaps you link to a style sheet like this:
<link href="CSS/main.css" rel="stylesheet" type="text/css" />
HTML5 doesn't require such precision, it's just as happy to see this:
<link href=CSS/main.css rel=stylesheet >
Did you notice that? There's no end tag/slash, there are no quotation marks around the attribute values, and there is no type declaration. However, easy going HTML5 doesn't care. The second example is just as valid as the first.
This more lax syntax applies across the whole document, not just linked assets. For example, specify a div like this if you like:
<div id=wrapper>
That's perfectly valid HTML5. The same goes for inserting an image:
<img SRC=frontCarousel.png aLt=frontCarousel>
That's also valid HTML5. No end tag/slash, no quotes, and a mix of capitalization and lower case characters. You can even omit things such as the opening <head> tag and the page still validates. What would XHTML 1.0 say about this?
Want a short-cut to great HTML5 code? Consider the HTML5 Boilerplate (http://html5boilerplate.com/). It's a pre-made "best practice" HTML5 file, including essential styles, polyfills, and optional tools such as Modernizr. You can pick up lots of great tips just by viewing the code and it's also possible to custom build the template to match your specific needs. Highly recommended!
Personally, I like writing my markup 'XHTML' style. That means closing tags, quoting attribute values, and adhering to a consistent letter case. One could argue that ditching some of these practices would save a few bytes of data but that's what tools are for (any needless characters/data could be stripped if needed). I want my markup to be as legible as possible and I would encourage others to do the same. I'm of the opinion that clarity in code should trump brevity.
When writing HTML5 documents therefore, I think you can write clean and legible code while still embracing the economies afforded by HTML5. To exemplify, for a CSS link, I'd go with the following:
<link href="CSS/main.css" rel="stylesheet"/>
I've kept the closing tag and the quotation marks but omitted the type attribute. The point to make here is that you can find a level you're happy with yourself. HTML5 won't be shouting at you, flagging up your markup in front of the class and standing you in a corner with a dunces hat on for not validating (was it just my school that did that?). However you want to write your markup is just fine.
Who am I kidding? I want you to know right now that if you're writing your code without quoting attribute values and closing your tags, I am silently judging you.
Despite HTML5's looser syntax, it's always worth checking whether your markup is valid. Valid markup is more accessible markup. The W3C validator was created for just this reason: http://validator.w3.org/
Enough of me berating writers of 'hipster' style markup. Let's look at some more benefits of HTML5.
A huge economy in HTML5 is that we can now wrap multiple elements in an <a> tag (woohoo! About time, right?). Previously, if you wanted your markup to validate, it was necessary to wrap each element in its own <a> tag. For example, look at the following HTML 4.01 code:
<h2><a href="index.html">The home page</a></h2> <p><a href="index.html">This paragraph also links to the home page</a></p> <a href="index.html"><img src="home-image.png" alt="home-slice" /></a>
With HTML5, we can ditch all the individual <a> tags and instead wrap the group with one:
<a href="index.html"> <h2>The home page</h2> <p>This paragraph also links to the home page</p> <img src="home-image.png" alt="home-slice" /> </a>
The only limitations to keep in mind are that, understandably, you can't wrap one <a> tag within another <a> tag (because, like, duh) or another interactive element such as a button (because like, double duh!) and you can't wrap a form in an <a> tag either (because like, oh, you get the idea).