Chapter 3. Writing More Meaningful Markup

In the previous chapter, you met HTML5’s semantic elements. With their help, you can give your pages a clean, logical structure and prepare for a future of super-smart browsers, search engines, and assistive devices.

But you haven’t reached the end of the semantic story yet. Semantics are all about adding meaning to your markup, and there are several types of information you can inject. In Chapter 2, semantics were all about page structure—you used them to explain the purpose of large blocks of content and entire sections of your layout. But semantics can also include text-level information, which you add to explain much smaller pieces of content. You can use text-level semantics to point out important types of information that would otherwise be lost in a sea of web page content, like names, addresses, event listings, products, recipes, restaurant reviews, and so on. Then this content can be extracted and used by a host of different services—everything from nifty browser plug-ins to specialized search engines.

In this chapter, you’ll start by returning to the small set of semantic elements that are built into the HTML5 language. You’ll learn about a few text-level semantic elements that you can use today, effortlessly. Next, you’ll look at the companion standards that tackle text-level semantics head-on. That means digging into microdata, which began its life as part of the original HTML5 specification but now lives on as ...

Get HTML5: The Missing Manual, 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.