HTML:Minimal Structure
At a bare minimum an HTML document should contain the following
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta name="description" content="Page Content described">
<title>Page Title</title>
</head>
<body>
...
</body>
</html>
- The
!DOCTYPEdeclaration defines the version of HTML grammar that the document professes to obey. Using the strict DTD makes only a marginal difference to standards-compliant browsers such as Firefox and Opera. However, using the strict DTD can make living with IE a great deal easier. - The
meta name="description"tag is not strictly necessary. However, by providing a meaningful description one may be able to influence the way a page will be described when it shows up in search engine results. - Likewise the
titletag may be used by search engines when they list a page in their results. In addition, most browsers display the title in their window caption. - The page content, as seen in a web browser, goes between the
<body>and</body>tags.
We should point out that most browsers will do a fair job of displaying HTML content even in the absence of a DOCTYPE declaration and a head section. While doing this may be excusable when all one seeks to do is create a simple HTML file for testing purposes it has no place in good web page design.
You may wonder why we do not mention the meta name="keywords" tag. The explanation is simple - the days of wide-eyed innocence when search engines provided search results by examining keywords offered via this specification are long gone. Today search engines use extremely sophisticated algorithms to examine and analyze full page content in order to serve up relevant search results to their users.
A few other uses for the meta tag are discussed here.