The Div Tag

ken's picture

Opening tag : <DIV>
Closing tag: </DIV>

Purpose:
Perhaps the most important tag you'll encounter on the web today. Originally the DIV tag was intended to divide the webpage into sections - perhaps different chapters. Now the Divide tag is commonly used to 'carry' CSS styles, through the class attribute. Closely related to DIV is the SPAN tag. The difference between DIV and SPAN is that DIV inserts a linebreak as it divides the webpage up.

Attributes:
align=alignment
- Specifies the alignment of the content within the DIV tag. Options are LEFT, RIGHT or CENTER.

class=class
- Specifies the class to be used for the content. Typically this is a CSS class specifying the style of the content.

dir=direction
- Useful for languages that should be read from right to left.

event=Javascript
- Allows javascript to be associated to events within the div tag.

lang=language
- Allows a language to be specified for the div tag.

nowrap
- Stops the browser from wrapping characters (without a BR tag).

style=style
- an alternative way of specifying the style of the content within this div.

title=title
- A title can also be given, perhaps to include keywords.

Example:

<Div class="navigation">
<p>Here is the navigation!</p>
</Div>

Related Tags:

-

Back to:
Alphabetical Guide
Guide By Type