Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.sao.ru/cats/~satr/JS/REF/tags2.htm
Дата изменения: Thu Mar 26 16:45:00 1998
Дата индексирования: Tue Oct 2 05:24:17 2012
Кодировка:

Поисковые слова: п п п р п р п р п р п
HTML Tag Reference [Contents] [Previous] [Next] [Alphabetical Tag List] [Index]

HTML Tag Reference

Tags for Document Structure

This section describes the tags that indicate the basic structure of a web page.


HTML

(outermost tag)

The HTML tag identifies a document as an HTML document. All HTML documents should start with the <HTML> tag and end with the </HTML> tag.

Syntax

<HTML>...</HTML>

Example

The following example begins and ends a short document with the HTML tag.

<HTML>
<BODY>
This is a small HTML file.
</BODY>
</HTML>

HEAD

(document header)

The HEAD tag defines an HTML document header. The header contains information about the document rather than information to be displayed in the document. The web browser displays none of the information in the header, except for text contained by the TITLE tag. You should put all header information between the <HEAD> and </HEAD> tags, which should precede the BODY tag.

The HEAD tag can contain TITLE, BASE, ISINDEX, META, SCRIPT, STYLE, and LINK tags.

Syntax

<HEAD>...</HEAD>

Example

<HEAD>
<TITLE> Mozilla speaks out</TITLE>
<BASE HREF="http://www.mozilla.com">
</HEAD>

BODY

(main content of document)

The BODY tag specifies the main content of a document. You should put all content that is to appear in the web page between the <BODY> and </BODY> tags.

The BODY tag has attributes that let you specify characteristics for the document. You can specify the background color or an image to use as a tiled background for the window in which the document is displayed. You can specify the default text color, active link color, unvisited link color, and visited link color. You can specify actions to occur when the document finishes loading or is unloaded, and when the window in which the document is displayed receives or loses focus.

Syntax

<BODY
  BACKGROUND="
bgURL"
  BGCOLOR="
color"
  TEXT="
color"
  LINK="
color"
  ALINK="
color"
  VLINK="
color"
  ONLOAD="
loadJScode"
  ONUNLOAD="
unloadJScode"
  ONBLUR="
blurJScode"
  ONFOCUS="
focusJScode"
    
CLASS="styleClass"
    ID="namedPlaceOrStyle"
    LANG="ISO"
    STYLE="style"
>
...
</BODY>

BACKGROUND="bgURL"

specifies an image to display in the background of the document. The URL value can be an absolute URL (for example, "http://www.yourcompany.com/images/image1.htm") or a relative URL (for example, "images/image1.gif"). The image is tiled, which means it is repeated in a grid to fill the entire window or frame where the document is displayed. Navigator 1.1.

BGCOLOR="color"

sets the color of the background. See "Color Units" for information about color values. Navigator 1.1

TEXT="color"

sets the color of normal text (that is, text that is not in a link) in the document. See "Color Units" for information about color values.

LINK="color"

sets the default text color of unvisited links in the document. An unvisited link is a link that has not been clicked on (or followed)..

ALINK="color"

specifies the color to which links briefly change when clicked. After flashing the ALINK color, visited links change to the VLINK color if it has been specified; otherwise they change to the browser's default visited link color.

VLINK="color"

specifies the text color of visited (followed) links in a document.

ONLOAD="loadJScode"

specifies JavaScript code to execute when the document finishes loading. For information about JavaScript, see the JavaScript Guide or the JavaScript Reference.

ONUNLOAD="unloadJScode"

specifies JavaScript code to execute when the document is unloaded.

ONFOCUS="focusJScode"

specifies JavaScript code to execute when the window in which the document is displayed receives an onFocus event, indicating that the window has acquired focus.

ONBLUR="blurJScode"

specifies JavaScript code to execute when the window in which the document is displayed receives an onBlur event, indicating that the window has lost focus.

Example

The following example sets the background color to light yellow, ordinary text to black, unvisited links to blue, visited links to green, and active links to red:

<BODY BGCOLOR="#FFFFAA" TEXT="black" LINK="blue" VLINK="green" ALINK="red">
...
</BODY>


[Contents] [Previous] [Next] [Alphabetical Tag List] [Index]

Last Updated: 01/26/98 21:33:44


Copyright © 1998 Netscape Communications Corporation