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.
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.
Deprecated. Sets the color of active links (i.e., the color while the mouse button is held down during a "click"). Color is specified in hexadecimal RGB values or by standard web color name. Chapter 16, "Specifying Color in HTML" explains these color specification methods.
Deprecated. Provides the URL to a graphic file to be used as a tiling graphic in the background of the document.
Deprecated. Sets the color of the background for the document. Color is specified in hexadecimal RGB values or by standard web color name.
Deprecated. Sets the default color for all the links in the document. Color is specified in hexadecimal RGB values or by standard web color name.
Deprecated. Sets the default color for all the non-hyperlink and unstyled text in the document. Color is specified in hexadecimal RGB values or by standard web color name.
Deprecated. Sets the color of the visited links (links that have already been followed) for the document. Color is specified in hexadecimal RGB values or by standard web color name.
Specifies the distance (in number of pixels) between the left and right browser edges and the text and graphics in the window.
Specifies the distance (in number of pixels) between the top and bottom edges of the browser and the text or graphics in the window.
When this attribute is set to fixed, the background image does not scroll with the document content.
Specifies the distance (in number of pixels) between the left browser edge and the beginning of the text and graphics in the window.
Specifies the distance (in number of pixels) between the top edge of the browser and the top edge of the text or graphics in the window.
<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>.
Provides the location of a predefined metadata profile that can be referenced by <meta> tags in the <head> of the document. This attribute is not yet implemented by browsers.
<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.
Indicates the direction the text should be rendered by the browser. The default is ltr (left-to-right), but some languages require rtl (right-to-left) rendering. The lang and dir attributes are part of the internationalization efforts incorporated into the HTML 4.01 specification. They can be added to almost any HTML element, but their use in the <html> tag is common for establishing the language for a whole document. For more information, see Chapter 7, "Internationalization".
Indicates the primary language of the document (see Chapter 7, "Internationalization" for more information and language codes).
Deprecated. Specifies the version of HTML the document uses (the value above specifies 4.01). It has been deprecated in favor of the SGML <!DOCTYPE> declaration placed before the <html> tag.
<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.
Required. Specifies the value of the meta tag property and is always used in conjunction with name= or http-equiv=.
<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.
Copyright © 2002 O'Reilly & Associates. All rights reserved.