Name
<div> — NN 2, 3, 4, 6 MSIE 3, 4, 5, 5.5, 6 HTML 4.01 WebTV Opera5
Synopsis
<div>...</div>
Denotes a generic “division” within the document. This
element can be used to add structure to an HTML document. When
<div> was first introduced in HTML 3.2, only
the alignment function (using the
align
attribute) was implemented by the
major browsers. While it has no presentation properties of its own,
it can be used in conjunction with the class and
id attributes and then formatted with style sheets
(Chapter 17). Because divisions are block elements,
they usually display with some added space above and below.
Attributes
-
align=center|left|right Deprecated. Aligns the text within the tags to the left, right, or center of the page.
-
class=name Assigns a name to an element or a number of elements. Elements that share a
classidentification can be treated as a group.
-
id=name Assigns a unique name to an element. There may not be two elements with the same
idname in a document.
-
style=style properties Embeds formatting information to be applied to the division contents.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access