Chapter 10. “Distributed,” “Extensibility,” and Other Fancy Words

Diving In

There are over 100 elements in HTML5. Some are purely semantic (see Chapter 3), and others are just containers for scripted APIs (see Chapter 4). Throughout the history of HTML (see Chapter 1), standards wonks have argued about which elements should be included in the language. Should HTML include a <figure> element? A <person> element? How about a <rant> element? Decisions are made, specs are written, authors author, implementors implement, and the Web lurches ever forward.

Of course, HTML can’t please everyone. No standard can. Some ideas don’t make the cut. For example, there is no <person> element in HTML5. (There’s no <rant> element either, damn it!) There’s nothing stopping you from including a <person> element in a web page, but it won’t validate, it won’t work consistently across browsers (see A Long Digression into How Browsers Handle Unknown Elements), and it might conflict with future HTML specs if it’s added later.

So if making up your own elements isn’t the answer, what’s a semantically inclined web author to do? There have been attempts to extend previous versions of HTML. The most popular method is with microformats, which use the class and rel attributes in HTML 4. Another option is RDFa, which was originally designed to be used in XHTML (see Postscript) but is now being ported to HTML as well.

Both microformats and RDFa have their strengths and weaknesses. They ...

Get HTML5: Up and Running 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.