The cover of The Complete Idiot's Guide to Create a Web Page The Complete Idiot's HTML Tag Reference

| Index | Previous Tag: <DIR> | Next Tag: <DL> |


<DIV>

Creates a section (division) of the page, which can then be formatted using a style sheet.

Support:

HTML StandardInternet ExplorerNetscape Navigator
3.0 and later 3.0 and later 2.0 and later
Notes:
  • Most browsers start a new line after this tag.
  • This tag requires the </DIV> end tag.
  • See also the <SPAN> tag.
Attributes:
ALIGN = "Text"
The horizontal alignment of text within the division.

Support:

HTML StandardInternet ExplorerNetscape Navigator
3.0 and later 3.0 and later 2.0 and later

Notes:

  • Possible values: LEFT, CENTER, RIGHT, JUSTIFY.

CLASS = "Text"
The style sheet class used by the tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 3.0 and later 4.0 and later

Notes:

  • You can specify two or more classes; be sure to separate each class name with a space.

CLEAR = "Text"
Determines whether the division text appears after an image if text is currently being wrapped around that image.

Support:

HTML StandardInternet ExplorerNetscape Navigator
3.0 and later Not supported Not supported

Notes:

  • The <IMG> tag's LEFT and RIGHT attributes enable you to wrap text around an image. If you use those attributes and the current text appears alongside an image, use the CLEAR attribute when you want the next line of text to begin below the image. (That is, when the left or right margin is clear of the image.) Use one of the following three values for this attribute:
    • LEFT—The next line appears when the left margin is clear.
    • RIGHT—The next line appears when the right margin is clear.
    • ALL—The next line appears when both the left and right margins are clear.

ID = "Text"
An alphanumeric string that uniquely identifies the tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 3.0 and later 4.0 and later

Notes:

  • Although you can use letters and numbers for the ID, the first character must be a letter.

LANG = "Text"
The language used by the tag's attribute values and text content.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

NOWRAP = "True/False"
Controls whether division text is automatically wrapped at the right edge of the browser window.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported Not supported Not supported

Notes:

  • If you set this attribute to True, the browser will only start a new line when you use the <BR> tag.

STYLE = "Text"
The style or styles to use with the tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 3.0 and later 4.0 and later

Notes:

  • If you enter multiple style properties, separate each one with a semi-colon (;).

Example:
This is unstyled text.
<DIV STYLE="color:chartreuse">
This is styled text.
</DIV>
How It Looks:
This is unstyled text.
This is styled text.

| Index | Previous Tag: <DIR> | Next Tag: <DL> |