The !DOCTYPE
The doctype tells the browser how it should parse your document; as such, it is an important part of the document
and it should be included in the first line of your HTML document. The previous doctype not only defined the
document as HTML4, it also provided a URL to the specification document, as shown in this example:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
The new HTML5 doctype is a lot simpler, and you no longer specify the version of HTML or the URL of the
specification document, as shown in this example:
<!DOCTYPE html>
The reason for the change is that HTML is a living specification where browsers will continue new parts of the
specifications as they pass through the standardization process. The idea is that in the future new features can be
added without further changes to the doctype.
Comments
Post a Comment