Sådan:
Document Structure
An XHTML document consists of three main parts:
the DOCTYPE;
the Head, and
the Body.
The basic document structure is
<!DOCTYPE ...>
<html ... >
<head> ... </head>
<body> ... </body>
</html>
The <head> contains information about the document, such as ownership, copyright, keywords, etc; and the <body> contains the document to be displayed.
Here's a minimal XHTML document:
1: <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
2: <html xmlns="
http://www.w3.org/1999/xhtml">3: <head>
3: <title>Minimal document</title>
5: </head>
6: <body>
7: <p>
8: <a href="
http://validator.w3.org/check/referer"> validate</a>
9: </p>
10:</body>
11:</html>
The numbers and colons are not part of the HTML file, but serve to associate the following comments with the lines above:
Specifies the document type.
Declares this to be an HTML document and declares an XML namespace.
The head contains items that are about the document.
The title used in the browser title bar, hotlists, listings, etc.
Closes the head.
body contains the document's displayable content.
Begins a paragraph.
An anchor, to the W3C validator.
Closes the paragraph.
Closes the body.
Closes the html.
<head> elements
<head>
<title>Web Developer's Virtual Library</title>
<base href = "
http://wdvl.internet.com/" />
<link rel = "STYLESHEET"
href = "/Authoring/Style/Sheets/NavMar.css"
type = "text/css" />
<meta name = "Description"
content = "The Original Encyclopedia of
Web Technology... " />
<meta name = "Keywords"
content = "
VR,CGI,CSS,DOM,URL,SQL,XML,CDF,MCF,OSD,RDF,XSL,
FAQ,FTP,DTD,DHTML,VRML,HTTP,UNIX,SGML," />
<meta name = "Copyright"
content = "1999 internet.com LLC" />
</head>
The <head> element contains 'metadata' for the document, and other information used by the browser but not displayed, e.g. the URI of a style sheet to appl