HTML and CSS Reference
In-Depth Information
<div>
Function
Defines a block of text
align
,
class
,
dir
,
id
,
lang
,
nowrap
,
onClick
,
onDblClick
,
onKeyDown
,
onKeyPress
,
onKeyUp
,
onMouseDown
,
onMouseMove
,
onMouseOut
,
onMouseOver
,
onMouseUp
,
style
,
title
Attributes
</div>
; usually omitted in HTML
End tag
Contains
body_content
Used in
block
4.1.1.1. The align attribute
The
align
attribute for
<div>
positions the enclosed content to the
left
(default),
center
, or
right
of the display. In addition, you can specify
jus-
tify
to align both the left and the right margins of the text. The
<div>
tag
may be nested, and the alignment of the nested
<div>
tag takes preced-
ence over the containing
<div>
tag. Further, other nested alignment tags,
such as
<center>
, aligned paragraphs (see
<p>
in section
4.1.2
), or spe-
cially aligned table rows and cells override the effects of
<div>
. Like the