HTML Reference Guide

Tag Index| Content List| HTML FAQ

<DIV> ... </DIV> Division Marker


The DIV element is a generic, catch-all Block Formatting element with an implied line break before and after. Within the realm of Style Sheets, this element is nestable to allow hierarchies of sections, subsections or chapters to be defined. This nesting ability also allows for powerful Style Sheet mechanisms to be applied.

The recent addition of the many linking attributes to DIV and SPAN appear to be an attempt to expand the generic block and in-line capabilities of these two elements.


align - This indicates the horizontal alignment of the Division block text in the browser window. These values can be over-ridden by style sheets values.

charset - This attribute indicates the character encoding of the destination resource of the HREF attribute.

href - This attribute indicates the URL to be loaded when the linked content is activated.

hreflang - This attribute specifies the base language of the resource indicated in the HREF attribute.

media - This attribute is a keyword representing the intended rendering destination for the style sheet properties applied to this element. Multiple destinations are given delimited by commas.

rel - The REL attribute is meant to give the relationship(s) described between the current document and the document specified by the HREF attribute.

rev - The REL attribute is basically meant to be the same as the REL attribute, but the semantics of the relationship are in the reverse direction. A link from A to B with REL="X" expresses the same relationship as a link from B to A with REV="X". Both the REL and REV attributes may be used in the same element.

target - This attribute specifies the named frame for the contents specified by the HREF attribute to load to when activated.

type - This attribute specifies the MIME type of the resource indicated in the HREF attribute.

Example code:

<div ALIGN="right" CLASS="greensection" STYLE="color: lime">text</div>



See Also: