Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.sao.ru/cats/~satr/JS/REF/tags4.htm
Дата изменения: Wed Jan 28 07:31:00 1998
Дата индексирования: Tue Oct 2 05:24:23 2012
Кодировка:

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

HTML Tag Reference

Block-Level Text Elements

This section discusses the tags that display block-level elements in text, such as headings, paragraphs, block quotes, and so on.


ADDRESS

(address format)

The ADDRESS tag displays address information in a format determined by each browser. Netscape Navigator displays addresses in italic. The intent of the ADDRESS tag is that it shows address information and is usually placed at the top or bottom of a document.

ADDRESS elements start on a new line. Most browsers do not add extra space before an ADDRESS element.

Syntax

<ADDRESS
  
CLASS="styleClass"
  ID="namedPlaceOrStyle"
  LANG="ISO"
  STYLE="style"
>...
</ADDRESS>

Example

<ADDRESS>
Netscape Communications Corporation<BR>
501 East Middlefield Road<BR>
Mountain View, CA 94043<BR>
</ADDRESS>
The file blocks.htm shows this example in action in a separate window.


BLOCKQUOTE

(indented block of text)

The BLOCKQUOTE tag indents a block of text. The intent of the BLOCKQUOTE tag is for quoting paragraphs, although you can use it anywhere that you want paragraphs to be indented. For inline citations, use the CITE tag.

BLOCKQUOTE elements start on a new line. Netscape Navigator adds extra space before a BLOCKQUOTE element, but not all browsers do.

Syntax

<BLOCKQUOTE>...
  
CLASS="styleClass"
  ID="namedPlaceOrStyle"
  LANG="ISO"
  STYLE="style"
>...
</BLOCKQUOTE>

Example

<BLOCKQUOTE>
Bob Lisbonne, vice president of client product marketing at
Netscape said:
<BLOCKQUOTE>
"Networked enterprises can begin to deploy Webtops as consistent
corporate computing interfaces that span all platforms and can
be updated dynamically."
</BLOCKQUOTE>
</BLOCKQUOTE>
The file blocks.htm shows this example in action in a separate window.


DIV

(section of a document)

The DIV tag encloses a block of content. The DIV tag is useful for applying alignment and style characteristics to a section of a document that contains multiple elements rather than having to apply the alignment and styles to each element in the block. Each DIV element starts on a new line. Navigator 2.0.

Syntax

<DIV
  ALIGN="LEFT"|"CENTER"|"RIGHT"
    
CLASS="styleClass"
    ID="namedPlaceOrStyle"
    LANG="ISO"
    STYLE="style"
>

ALIGN

specifies the horizontal alignment of the block of content. The value can be one of the following:

Example

The following example uses a DIV tag to apply a style to a right-aligned block of content. The STYLE attribute is a universal attribute available to all tags inside the body of a document, and is discussed in the section Universal Attributes.

<DIV ALIGN=RIGHT STYLE=REDSTYLE>
<H1>Aligning a Block of Content to the Right</H1>
<P>You can use a DIV tag to align a block of content to the right.</P>
<P>The content can include anything you like, including tables,
images, lists, and so on. Note, however, that right-aligned lists
often do not look very neat.</P>
</DIV>
The file blocks.htm shows this example in action in a separate window.


H1 through H6

(standard headings)

The tags H1, H2, H3, H4, H5, and H6 display headings. Level 1 headings (H1) are the most prominent headings, and level 6 headings (H6) are the least prominent. Headings are usually displayed in a bolder, larger font than normal body text.

Heading elements start on a new line. All browsers add extra space before heading elements.

Syntax

<H1 ALIGN="LEFT"|"CENTER"|"RIGHT">...</H1>
<H2 ALIGN="LEFT"|"CENTER"|"RIGHT">...</H2>
<H3 ALIGN="LEFT"|"CENTER"|"RIGHT">...</H3>
<H4 ALIGN="LEFT"|"CENTER"|"RIGHT">...</H4>
<H5 ALIGN="LEFT"|"CENTER"|"RIGHT">...</H5>
<H6 ALIGN="LEFT"|"CENTER"|"RIGHT">...</H6>

All the headings from H1 through H6 can also take the following universal attributtes:

  CLASS="styleClass"
  ID="namedPlaceOrStyle"
  LANG="ISO"
  STYLE="style"

ALIGN

specifies the horizontal alignment of the heading. The value can be one of these:

Example

<H1>Level 1 Heading</H1>
<H2>Level 2 Heading</H2>
<H3>Level 3 Heading</H3>
<H4>Level 4 Heading</H4>
<H5>Level 5 Heading</H5>
<H6>Level 6 Heading</H6>
The file blocks.htm shows this example in action in a separate window.


P

(paragraph)

The P tag displays a paragraph. All P elements start on a new line and are usually preceded by extra space.

You can also use the P tag to insert a line break with extra space. To insert a line break without adding extra space, use the BR tag.

The closing </P> tag guarantees that the paragraph is followed by extra space. Omitting the closing </P> tag often has no effect, especially if the P tag is being used as a line break (that is, the paragraph has no content), or the paragraph is followed by an element that starts on a new line and is preceded by extra space.

Syntax

<P
  ALIGN="LEFT"|"CENTER"|"RIGHT"
    
CLASS="styleClass"
    ID="namedPlaceOrStyle"
    LANG="ISO"
    STYLE="style"
>
...
</P>

ALIGN

specifies the horizontal alignment of the paragraph. Navigator 1.1.

The value can be one of these:

Example

The following example displays two paragraphs.

<P>Use the P tag to display paragraphs. The P element
starts on a new line, and is preceded by extra space.
<P>
You can also use the P tag to insert a line break with
extra space.In most, but not all, cases, it is OK to omit
the closing tag.
</P>
The file blocks.htm shows this example in action in a separate window.


PRE

(preformatted text, fixed-width font)

The PRE tag displays preformatted text in a fixed-width font. The PRE element displays all white space and line breaks exactly as they appear inside the <PRE> and </PRE> tags.

Using this tag, you can insert and reproduce formatted text, preserving its original layout. This tag is frequently used to show code listings, tabulated information, and blocks of text that were created for some text-only form, such as electronic mail messages and news postings.

Unlik the XMP and PLAINTEXT tags, the PRE tag does not suppress interpretation of other HTML tags. Since the PRE element interprets HTML tags, you must use special symbols for any character that has a meaning in HTML that you wish to be displayed rather than interpreted. For example, use &lt; for the < symbol, and use &gt; for the > symbol.

All PRE elements start on a new line, preceded by extra space.

Syntax

<PRE
  COLS="
columns"
  WRAP
  
CLASS="styleClass"
  ID="namedPlaceOrStyle"
  LANG="ISO"
  STYLE="style"
>...
</PRE>

COLS="columns"

specifies the maximum number of characters that fit on a line. This effectively turns on wrapping, and lets you specify the line width in characters.

WRAP

turns on wrapping, so that all lines fit inside the browser.

Example

The mail message said:
<PRE>
To: Lee Smith
From: Chris Brown
Subject: Meeting schedule and agenda for Web Site team
Date: Thurs, 14 Aug 1997 22:00:05

9/20/97    8:00 a.m.   Room 218
9/21/97    9:00 a.m.   Room 218
9/22/97    2:00 p.m.   Room 111

At the first meeting, we should discuss how to use
the &lt;STYLE&gt; tag to make our home page more interesting.
</PRE>
The file blocks.htm shows this example in action in a separate window.


XMP

(sequence of literal characters)

The XMP tag displays a sequence of literal characters in the browser's default fixed-width font. The XMP element displays all white space and line breaks exactly as they appear inside the <XMP> and </XMP> tags.

You can use the XMP tag to display text that includes characters that HTML normally interprets, such as the < and > symbols that enclose an HTML tag.

All XMP elements start on a new line, preceded by extra space.

Syntax

<XMP
  
CLASS="styleClass"
  ID="namedPlaceOrStyle"
  LANG="ISO"
  STYLE="style"
>...
</XMP>

Example

<P>The basic structure of an HTML document is:
<XMP>
<HTML>
 <HEAD> header info goes here </HEAD>
 <BODY> body content goes here </BODY>
</HTML>
</XMP>

The file blocks.htm shows this example in action in a separate window.


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

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


Copyright © 1998 Netscape Communications Corporation