HTML and CSS Reference
In-Depth Information
Document Declaration
With so many HTML specifications, how is the web browser supposed to know to correctly
parse the document? The absolute top of any HTML document contains one additional ele-
ment called a DOCTYPE declaration. The DOCTYPE declaration is an instruction found
above the opening <html> tag that tells the web browser what version of HTML the docu-
ment uses. For HTML5 we simply write the following piece of code:
<!doctype html>
<html>
<head>
The DOCTYPE declaration isn't exactly a tag or an element. As its name states, it is simply
a declaration.
HTML5 has greatly simplified the DOCTYPE declaration, as in previous revisions this was
a very illegible piece of code. The following example is the DOCTYPE declaration for the
HTML 4.01 Strict specification.
<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Strict//EN” “http://www.w3.org/TR/html4/strict.dtd”>
If for any reason we don't want to use the HTML5 DOCTYPE, our second choice should be
the HTML 4.01 Strict DOCTYPE. The "strict" part refers to the removal of all the deprec-
ated tags, and it is great for pages that are absolutely correct against the standard.
With that said, our main document structure for the sample CV should look like this:
<!DOCTYPE html>
<html>
<head>
<meta charset=”utf-8” />
<title>Curriculum Vitae</title>
</head>
<body>
</body>
 
Search WWH ::




Custom Search