HTML and CSS Reference
In-Depth Information
simply <!DOCTYPE html> . Following the document type declaration, the <html> ele-
ment signifies the beginning of the document.
Inside the <html> element, the <head> element identifies the top of the document, in-
cluding any metadata (accompanying information about the page). The content inside the
<head> element is not displayed on the web page itself. Instead, it may include the docu-
ment title (which is displayed on the title bar in the browser window), links to any external
files, or any other beneficial metadata.
All of the visible content within the web page will fall within the <body> element. A
breakdown of a typical HTML document structure looks like this:
Click here to view code image
1. <!DOCTYPE html>
2. <html lang="en">
3. <head>
4. <meta charset="utf-8">
5. <title>Hello World</title>
6. </head>
7. <body>
8. <h1>Hello World</h1>
9. <p>This is a web page.</p>
10. </body>
11. </html>
The preceding code shows the document beginning with the document type declaration,
<!DOCTYPE html> , followed directly by the <html> element. Inside the <html> ele-
ment come the <head> and <body> elements. The <head> element includes the char-
acter encoding of the page via the <meta charset="utf-8"> tag and the title of
the document via the <title> element. The <body> element includes a heading via the
<h1> element and a paragraph via the <p> element. Because both the heading and para-
graph are nested within the <body> element, they are visible on the web page (see Figure
1.3 ) .
Figure 1.3 A simple web page
Search WWH ::

Custom Search