HOME
MAIN
NEXT
HTML Block Elements Summary
HOME
MAIN
NEXT
BODY Element: Document Text Body
Usage:
<BODY>...</BODY>
Can Contain: characters, character highlighting,
A, APPLET, BR, IMG,
BASEFONT, MAP, SCRIPT, [ISINDEX], INPUT, SELECT, TEXTAREA,
DIR, DL, MENU, OL, UL, P, HR, Hn,
ADDRESS, BLOCKQUOTE, CENTER, DIV, FORM, PRE, TABLE
Can Be Inside: HTML
Attributes: ALINK,
BACKGROUND, BGCOLOR, LINK, TEXT, VLINK,
(BGPROPERTIES, LEFTMARGIN, TOPMARGIN Internet Explorer
only)
BODY contains the document proper, as opposed to the meta-information found in the
HEAD.
- Attributes
- BACKGROUND="url" BACKGROUND image files (GIF
or JPEG). Example: <BODY BACKGROUND="icons/home.gif">
- BGCOLOR="#rrggbb" or "color"
background color. If a BACKGROUND image is also specified, the
background will first be tiled with this color, and then with the image.
If the BACKGROUND image is transparent, the color behind the
background is given by BGCOLOR.
- 000000: Black; 000080=Navy; 0000FF=Blue; 008000=Green
- 008080=Teal; 00FF00=Lime; 00FFFF=Aqua; 800000=Maroon
- 800080=Purple; 808000=Olive; 808080=Gray; C0C0C0=Silver
- FF0000=Red; FF00FF=Fuchsia; FFFF00=Yellow; FFFFFF=White
- ALINK="#rrggbb" or "color" Specifies the color for the text within active (i.e., selected)
links. The default is maybe red.
- TEXT="#rrggbb" or "color" Specifies the default color for the document text. The default is black.
- LINK="#rrggbb" or "color" Specifies the color for text within unvisited hypertext links. The
default is usually blue.
- VLINK="#rrggbb" or "color" Specifies the color for text within previously visited hypertext links.
The default is usually pale purple.
HOME
MAIN
NEXT
PREV
ADDRESS Element: Address information
Usage:
<ADDRESS>...</ADDRESS>
Can Contain: characters, character highlighting,
A, APPLET, BR, IMG,
BASEFONT, MAP, SCRIPT, INPUT, SELECT, TEXTAREA, P
Can Be Inside: BLOCKQUOTE, BODY, CENTER, DIV, FORM, TD, TH
Attributes: none
ADDRESS denotes information such as addresses, electronic signatures, or
list of authors.
TOP
- Example 1: Single line ADDRESS
<ADDRESS><A HREF="mailto:[email protected]">C.S.O</A></ADDRESS>
- Example 1 Output: Single line ADDRESS
C.S.O
TOP
<ADDRESS>Santa Claus<BR>
Christmas Holiday Specialist<BR>
North pole, CANADA HOHOHO<BR>
Tel: (555) 555-POLE
</ADDRESS>
- Example 2 Output: Block ADDRESS
Santa Claus
Christmas Holiday Specialist
North pole, CANADA HOHOHO
Tel: (555) 555-POLE
HOME
MAIN
NEXT
PREV
BLOCKQUOTE Element: Block Quotations
Usage:
<BLOCKQUOTE>...</BLOCKQUOTE>
Can Contain: characters, character highlighting,
A, APPLET, BR, IMG,
BASEFONT, MAP, SCRIPT, [ISINDEX], INPUT, SELECT, TEXTAREA,
DIR, DL, MENU, OL, UL, P, HR, Hn,
ADDRESS, BLOCKQUOTE, CENTER, DIV, FORM, PRE, TABLE
Can Be Inside: BLOCKQUOTE, BODY, CENTER, DD, DIV, FORM, LI,
TD, TH
Attributes: none
BLOCKQUOTE marks a block of text as a quotation. Browsers can render this
in various ways: for example, by indenting the BLOCKQUOTE element, and by
offsetting it from the preceding and following text. A BLOCKQUOTE also
causes a paragraph break, and terminates preceding paragraph
TOP
<BLOCKQUOTE>Here is
an example of BLOCKQUOTE. Here is an example of BLOCKQUOTE.
Here is an example of BLOCKQUOTE. Here is an example of BLOCKQUOTE.</BLOCKQUOTE>
- Example 1 Output: BLOCKQUOTE
Here is an example of BLOCKQUOTE. Here is an example of BLOCKQUOTE.
Here is an example of BLOCKQUOTE. Here is an example of BLOCKQUOTE.
HOME
MAIN
NEXT
PREV
CENTER Element: Center the enclosed text horizontally
Usage:
<CENTER>...</CENTER>
Can Contain: characters, character highlighting,
A, APPLET, BR, IMG,
BASEFONT, MAP, SCRIPT, [ISINDEX], INPUT, SELECT, TEXTAREA,
DIR, DL, MENU, OL, UL, P, HR, Hn,
ADDRESS, BLOCKQUOTE, CENTER, DIV, FORM, PRE, TABLE
Can Be Inside: BLOCKQUOTE, BODY, CENTER, DD, DIV, FORM, LI,
TD, TH
Attributes: none
CENTER center-align text enclosed within the element, include any enclosed blocks of text, with the exception
of left- or right-aligned images or tables, or block elements for which the
alignment is specified by the element's own alignment attribute. In particular, CENTER
is often used to center a TABLE between margins. Note that CENTER
introduces a line break both before and after the centered text, so that only
the enclosed text is centered-- CENTER does not introduce any extra
spacing beyond that of regular line break.
TIP: Use DIV with ALIGN="center" instead of CENTER.
DIV can be linked easily to stylesheet formatting control, while CENTER
can not.
TOP
<CENTER>Here is an
example of CENTER. Here is an example of CENTER.
Here is an example of CENTER. Here is an example of CENTER.
Here is an example of CENTER. Here is an example of CENTER.</CENTER>
Here is an example of CENTER. Here is an example of CENTER.
Here is an example of CENTER. Here is an example of CENTER.
Here is an example of CENTER. Here is an example of CENTER.
HOME
MAIN
NEXT
PREV
DIV Element: A block division of a document
Usage:
<DIV>...</DIV>
Can Contain: characters, character highlighting,
A, APPLET, BR, IMG,
BASEFONT, MAP, SCRIPT, [ISINDEX], INPUT, SELECT, TEXTAREA,
DIR, DL, MENU, OL, UL, P, HR, Hn,
ADDRESS, BLOCKQUOTE, CENTER, DIV, FORM, PRE, TABLE
Can Be Inside: BLOCKQUOTE, BODY, CENTER, DD, DIV, FORM, LI,
TD, TH
Attributes: ALIGN
DIV marks a block of the document as a logical group or division,
and is used to specify generic property for the entire block.
- Attributes
- ALIGN="left, "right", or "center"
TOP
- Example 1: DIV with ALIGN="left"
<DIV ALIGN="left">
<b>DIV</b>
with <b>ALIGN</b>="left"
indicates that all the text within the
DIV element should be left-aligned, unless this alignment specification is
overridden by an element within the DIV</DIV>
- Example 1 Output: DIV with ALIGN="left"
DIV with ALIGN="left" indicates that all the text within the
DIV element should be left-aligned, unless this alignment specification is
overridden by an element within the DIV
TOP
- Example 2: DIV with ALIGN="right"
<DIV ALIGN="right">
<b>DIV</b>
with <b>ALIGN</b>="right"
indicates that all the text within the
DIV element should be right-aligned, unless this alignment specification is
overridden by an element within the DIV</DIV>
- Example 2 Output: DIV with ALIGN="right"
DIV with ALIGN="right" indicates that all the text within the
DIV element should be right-aligned, unless this alignment specification is
overridden by an element within the DIV
TOP
- Example 3: DIV with ALIGN="center"
<DIV ALIGN="center">
<b>DIV</b>
with <b>ALIGN</b>="center"
indicates that all the text within the
DIV element should be center-aligned, unless this alignment specification is
overridden by an element within the DIV</DIV>
- Example 3 Output: DIV with ALIGN="center"
DIV with ALIGN="center" indicates that all the text within the
DIV element should be center-aligned, unless this alignment specification is
overridden by an element within the DIV
HOME
MAIN
NEXT
PREV
MULTICOL Element: Multicolumn Text (Netscape Navigator only)
Usage:
<MULTICOL>...</MULTICOL>
Can Contain: Unspecified; probably: characters, character highlighting,
A, APPLET, BR, IMG,
BASEFONT, MAP, NOSCRIPT, SCRIPT, SPACER, [ISINDEX], WBR,
INPUT, SELECT, TEXTAREA, EMBED, NOEMBED, OBJECT,
DIR, DL, MENU, OL, UL, P, HR, Hn,
ADDRESS, BLOCKQUOTE, CENTER, DIV, FORM, MULTICOL, PRE, TABLE
Can Be Inside: Unspecified; probably: ADDRESS, BLOCKQUOTE, BODY, CENTER,
DD, DIV, FORM,
MULTICOL, LI,
TD, TH, APPLET, NOEMBED, OBJECT
Attributes: COLS,
GUTTER, WIDTH
MULTICOL specifies text to be displayed in multicolumn format, with the
attributes specifying the number of columns to use and the spacing to leave
between columns.
- Attributes
- COLS="number" (mandatory) Specifies the number of
columns to use. The default is 1.
- GUTTER="number" (optional) Specifies the space to
leave between the columns, in pixels. The default value is 10.
- WIDTH="number" or "number%" (optional)
Specifies the width for the entire collection of columns, either as an
absolute width, in pixels (number) or as a percentage of the
available width (number%).
- Examples:
- Example 1: MULTICOL with COLS="2",
GUTTER="15" (Netscape Navigator only)
TOP
- Example 1: MULTICOL with COLS="2", GUTTER="15" (Netscape Navigator only)
<MULTICOL COLS="2"
GUTTER="15">
<P>Here is the paragraph for the first column
text. Here is the paragraph for the first column text.
<P>Here is the
paragraph for the second column text. Here is the paragraph for the second
column text.
</MULTICOL>
- Example 1 Output: MULTICOL with COLS="2", GUTTER="15" (Netscape Navigator only)
Here is the paragraph for the first column text. Here is the paragraph for the first column text.
Here is the paragraph for the second column text. Here is the paragraph for the second column text.
HOME
MAIN
NEXT
PREV
P Element: Paragraph
Usage:
<P>...(</P>)
Can Contain: characters, character highlighting,
A, APPLET, BR, IMG,
BASEFONT, MAP, SCRIPT, INPUT, SELECT, TEXTAREA
Can Be Inside: ADDRESS, BLOCKQUOTE, BODY, CENTER, DD, DIV, FORM, LI,
TD, TH
Attributes: ALIGN
P
marks a paragraph block.
- Attributes:
- ALIGN="left", "center", "right", "justify"
["justify"--proposed]
(optional)
TOP
- Example 1: P with ALIGN="left"
<P ALIGN="left"><b>ALIGN</b>="left":
left-justify the text. This is a long paragraph.
This is a long paragraph. This is a long paragraph. This is a long paragraph.
This is a long paragraph.
This is a long paragraph. This is a long paragraph. This is a long paragraph.
This is a long paragraph.
</P>
- Example 1 Output: P with ALIGN="left"
ALIGN="left": left-justify the text. This is a long paragraph.
This is a long paragraph. This is a long paragraph. This is a long paragraph. This is a long paragraph.
This is a long paragraph. This is a long paragraph. This is a long paragraph. This is a long paragraph.
TOP
- Example 2: P with ALIGN="right"
<P ALIGN="right"><b>ALIGN</b>="right":
right-justify the text. This is a long paragraph.
This is a long paragraph. This is a long paragraph. This is a long paragraph.
This is a long paragraph.
This is a long paragraph. This is a long paragraph. This is a long paragraph.
This is a long paragraph.
- Example 2 Output: P with ALIGN="right"
ALIGN="right": right-justify the text. This is a long paragraph.
This is a long paragraph. This is a long paragraph. This is a long paragraph. This is a long paragraph.
This is a long paragraph. This is a long paragraph. This is a long paragraph. This is a long paragraph.
TOP
- Example 3: P with ALIGN="center"
<P ALIGN="center"><b>ALIGN</b>="center":
center the text between the margins. This is a long paragraph.
This is a long paragraph. This is a long paragraph. This is a long paragraph.
This is a long paragraph.
This is a long paragraph. This is a long paragraph. This is a long paragraph.
This is a long paragraph.
- Example 3 Output: P with ALIGN="center"
ALIGN="center": center the text between the margins. This is a long paragraph.
This is a long paragraph. This is a long paragraph. This is a long paragraph. This is a long paragraph.
This is a long paragraph. This is a long paragraph. This is a long paragraph. This is a long paragraph.
TOP
- Example 4: P with ALIGN="justify"
<P ALIGN="justify"><b>ALIGN</b>="justify":
justify the text between left and right margin.
This is a long paragraph. This is a long paragraph. This is a long paragraph.
This is a long paragraph.
This is a long paragraph. This is a long paragraph. This is a long paragraph.
This is a long paragraph.
- Example 4 Output: P with ALIGN="justify"
ALIGN="justify": justify the text between left and right margin.
This is a long paragraph. This is a long paragraph. This is a long paragraph. This is a long paragraph.
This is a long paragraph. This is a long paragraph. This is a long paragraph. This is a long paragraph.
HOME
MAIN
PREV
PRE Element: Preformatted Text
Usage:
<PRE>...</PRE>
Can Contain: characters, B, CITE, CODE,
DFN, EM, I, KBD, S, SAMP,
STRIKE, STRONG, TT, U, VAR, A, APPLET, BR,
MAP, SCRIPT, INPUT, SELECT, TEXTAREA
Can Be Inside: BLOCKQUOTE, BODY, CENTER, DD, DIV, FORM, LI,
TD, TH
Attributes: WIDTH
PRE marks text to be displayed with a fixed-width typewriter font. In
particular, the PRE environment preserves the line breaks and space characters
of the original text--this is the only HTML element that does so.
- Attributes:
- WIDTH="number"
(optional) Specifies the maximum number of characters that can be
displayed on a single line, and which tells a browser that it can wrap
the line at this point. Most graphical browsers ignore the WIDTH
and never wrap text inside PRE--users can use scroll bars to see
text that runs of display.
TOP
<PRE>Example of
<PRE></PRE>. Presentation AS-IS. No
<IMG>, <P>, heading elements, list elements,
and <ADDRESS> in <PRE>
</PRE>
Example of <PRE></PRE>. Presentation AS-IS. No <IMG>, <P>, heading elements, list elements,
and <ADDRESS> in <PRE>
TOP
- Example 2: PRE inside a P
<P> A
<PRE>text>/PRE> inside a paragraph will start on a
new line. <PRE>This
text is inside
<B>PRE</B>,
and it starts on a new line.</PRE>
- Example 2 Output: PRE inside a P
A <PRE>text>/PRE> inside a paragraph will start on a new line.
This text is inside
PRE, and it starts on a new line.
HOME
MAIN
PREV