Structural HTML Tags

Contents:

Summary of Structural Tags
Setting Up an HTML Document
Global Settings with the <body> Tag
Using <meta> Tags

This chapter looks at the subset of HTML tags that is used primarily to give the document structure. It also discusses tags that are used for providing information about the document and those used for controlling its appearance or function on a global level.

Summary of Structural Tags

In this section, browser support for each tag is noted to the right of the tag name. Browsers that do not support the tag are grayed out. Tag usage is indicated below the tag name. Start and end tags are required unless otherwise noted. "Deprecated" means that the tag or attribute is currently supported but is due to be phased out of the HTML specification and is discouraged from use (usually in favor of similar style sheet controls). The attributes listed for each tag reflect those in common use. A more thorough listing of attributes for each tag, according to the HTML 4.01 specification, appears in Appendix A, "HTML Elements".

<body> NN 2, 3, 4, 6 MSIE 2, 3, 4, 5, 5.5, 6 HTML 4.01 WebTV Opera5

<body>...</body> (start and end tags optional)

Defines the beginning and the end of the document body. The body contains the content of the document (the part that is displayed in the browser window). Attributes to the <body> tag affect the entire document.

Attributes

Netscape Navigator 4.0+ only

Internet Explorer only

<head> NN 2, 3, 4, 6 MSIE 2, 3, 4, 5, 5.5, 6 HTML 4.01 WebTV Opera5

<head>...</head> (start and end tags optional)

Defines the head (also called "header") portion of the document that contains information about the document. The <head> tag has no directly displayed content, but serves only as a container for the other header tags, such as <base>, <meta>, and <title>.

Attributes

<html> NN 2, 3, 4, 6 MSIE 2, 3, 4, 5, 5.5, 6 HTML 4.01 WebTV Opera5

<html>...</html> (start and end tags optional)

Placed at the beginning and end of the document, this tag tells the browser that the entire document is composed in HTML.

Attributes

<meta> NN 2, 3, 4, 6 MSIE 2, 3, 4, 5, 5.5, 6 HTML 4.01 WebTV Opera5

<meta> (end tag forbidden)

Provides additional information about the document. It should be placed within the <head> tags at the beginning of the document. It is commonly used for making documents searchable (by adding keywords) or to specify the character set for a document. They have been used for client-pull functions, but this function is discouraged. Meta tags are discussed at the end of this chapter.

Attributes

<title> NN 2, 3, 4, 6 MSIE 2, 3, 4, 5, 5.5, 6 HTML 4.01 WebTV Opera5

<title>...</title>

Required. Specifies the title of the document. The title generally appears in the top bar of the browser window. According to the HTML 4.01 specification, all documents must contain a meaningful <title> within the <head> of the document.