<DIV> — NN all IE all HTML 3.2
End Tag: Required
element gives structure and context to any block-level content in a
document. Unlike some other structural elements that have very
specific connotations attached to them (the
element, for instance), the author is free to give meaning to each
DIV element by virtue of the
element’s attribute settings and nested content. Each
DIV element becomes a generic block-level
container for all content within the required start and end tags.
As a basic example, the
DIV element is now
recommended as the element to use to center text on a page, in place
of the deprecated
CENTER element. The
DIV element that does the work includes style
information that takes care of the centering of the content. It is
also convenient to use the
DIV element as a
wrapper for multielement content that is to be governed by a single
style sheet rule. For example, if a block of content includes three
paragraphs, rather than assign a special font style to each of the
P elements, you can wrap all three
P elements with a single
element whose style sheet defines the requested font style. Such a
style sheet could be defined as an inline
attribute of the
DIV element or assigned via the
depending on the structure of the rest of the document.
DIV elements are block-level elements. If you need
an arbitrary container for inline content, use the
SPAN element, instead.
HTML 4.0 defines many more attributes ...