The <DIV> element, as described in the HTML 3.2 specification, should be used with Style Sheet attributes (as used in Internet Explorer), to name a section of text as being of a certain style. Netscape has implemented the <DIV> element to work as the <P ALIGN= ...> element. Essentially, text surrounded by the <DIV> ... >/DIV> elements will be formatted according to the description attached to the ALIGN attribute within the <DIV> elements.

For example :

<DIV ALIGN="left">This text will be displayed left aligned in the browser window.</DIV>
<DIV ALIGN="center">This text will be centred.</DIV>
<DIV ALIGN="right">This text will be displayed aligned to the right of the browser window.</DIV>

would render as:

This text will be displayed left aligned in the browser window.
This text will be centred.
This text will be displayed aligned to the right of the browser window.

Internet Explorer supports the use of the <DIV> element (as well as the above method) when used with the ActiveX HTML Layout Control and Style Sheets. This allows sections of a HTML document to be authored with a fixed layout, according to the W3C 2-D layout specification. Browsers normally determine the best possible layout for HTML, but sections authored using the HTML Layout Control are fixed. Users should seek out the ActiveX Control Pad for more information about authoring using the fixed layout control.

<DIV> can also take the CLASS, ID and STYLE attributes to allow style sheet definitions to be applied to it. For more details of these attributes, see the Style Sheets topic.


<DFN> Block Formatting Elements Overview <FONT>