Skip to Content
HTML5 Hacks
book

HTML5 Hacks

by Jesse Cravens, Jeff Burtoft
November 2012
Intermediate to advanced
500 pages
11h 21m
English
O'Reilly Media, Inc.
Content preview from HTML5 Hacks

Chapter 1. Hacking the Semantic Way

The spirit of HTML5 is simplicity. HTML5 has made it easy to implement web standards that in the past have been difficult to implement. Instead of trying to reinvent the Web, visionary consortiums such as the WHATWG (Web Hypertext Application Technology Working Group) and the W3C (World Wide Web Consortium) looked at the web standards that had evolved and built upon them.

In essence, HTML5 is primarily an update to the HyperText Markup Language (HTML). In this chapter we will start with the basic building blocks of HTML, the semantic elements, to provide a foundation for the simple yet powerful new web browser technologies exposed within this book.

So, open up your favorite code editor, brew a pot of coffee, and get ready to code in the most powerful language the Web has ever seen: HTML5!

Hack 1. Simplify Your Doc with the Right <doctype>

If there’s an emblem representing the simplicity HTML5 brings to the markup world, it’s the <DOCTYPE> tag. The HTML5 <doctype> tag is easy to use.

When you open an XHTML document the first thing you see, the first line of the document, is a mess:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

The <DOCTYPE> tag of HTML past, inherited from its SGML foundations, consisted of three main components: the tag name, the public identifier string, and the DTD (Document Type Definition) URL. It’s a strange mix of uppercase and lowercase letters, quote ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

HTML5 Games: Novice to Ninja

HTML5 Games: Novice to Ninja

Earle Castledine
HTML5 Unleashed

HTML5 Unleashed

Simon Sarris

Publisher Resources

ISBN: 9781449335052Errata