Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

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

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 marks and slashes, and a URL that brings up an even less readable file. To make it even stranger, the <DOCTYPE> tag is unique, as it is the only HTML tag since HTML 4.01 that is in all caps.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint