Chapter 12. HTML5 Markup: Modern HTML

image with no caption

So, we’re sure you’ve heard the hype around HTML5. And, given how far along you are in this book, you’re probably wondering if you made the right purchase. Now, one thing to be clear about, up front, is that everything you’ve learned in this book has been HTML, and more specifically has met the HTML5 standard. But there are some new aspects of HTML markup that were added with the HTML5 standard that we haven’t covered yet, and that’s what we’re going to do in this chapter. Most of these additions are evolutionary, and you’re going to find you are quite comfortable with them given all the hard work you’ve already done in this book. There’s some revolutionary stuff too (like video), and we’ll talk about that in this chapter as well. So, let’s dive in and take a look at these new additions!

Rethinking HTML structure

Before we learn even more markup, let’s step back for a second...we’ve talked a lot about structure, but are <div>s really good structure? After all, the browser doesn’t really know your <div id="footer"> is a footer, it just knows it is a <div>, right? That seems rather unsatisfying, doesn’t it?

Much of the new HTML5 markup is aimed at recognizing how people structure their pages with <div>s and providing markup that is more specific, and better suited for certain kinds of structure. You see, when the browser (or search engines, or screen ...

Get Head First HTML and CSS, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.