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.
Description:
This indicates the horizontal alignment of the Division block text in
the browser window. These values can be over-ridden by style sheets
values.
Values:Left [DEFAULT] |
Center | Right |
Justify
Charset
2 | 3
| 3.2 | 4
| IE | M
| N
Required? No
Description:
This attribute indicates the character encoding of the destination
resource of the HREF attribute.
Values:
A recognized RFC 2045 language character set string.
Default is ISO-8859-1.
Href
2 | 3
| 3.2 | 4
| IE | M
| N
Required? No
Description:
This attribute indicates the URL to be loaded when the linked
content is activated.
Values: Either relative or absolute URLs.
Hreflang
2 | 3
| 3.2 | 4
| IE | M
| N
Required? No
Description:
This attribute specifies the base language of the resource indicated
in the HREF attribute.
Description:
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.
Values: screen [DEFAULT]
- style information should be used for rendering to computer
screens. print - style information
should be used for rendering to page-centric devices, ie:
printed paper or print preview screen modes. projection - style information
should be used for rendering to transparent projected media
devices. braille - style information
should be used for rendering to braille devices. speech - style information
should be used for rendering to speech synthesizers. all - style information
should be used for rendering to all devices.
Rel
2 | 3
| 3.2 | 4
| IE | M
| N
Required? No
Description:
The REL attribute is meant to give the relationship(s) described between
the current document and the document specified by the HREF attribute.
Values: A whitespace separated list of relationship names.
Rev
2 | 3
| 3.2 | 4
| IE | M
| N
Required? No
Description:
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.
Values: A whitespace separated list of relationship names.
Target
2 | 3
| 3.2 | 4
| IE | M
| N
Required? No
Description:
This attribute specifies the named frame for the contents specified
by the HREF attribute to load to when activated.
The DIV element is an all-purpose, generalized HTML
Block Structure. Use this element when
you wish to define a block or section of Styled text, and
SPAN when you wish to create a generalized
in-line Character Formatting element.
Note that the DIV element was not listed in the
Block Formatting section, even though it is a
Block Level element. DIV is a generic element and does not attach any
semantic meaning. It is of greatest use when working with Style Sheets,
so it is grouped with other elements of this category.
DIV CLASSes can be nested. This allows for more powerful Style
Sheet mechanisms. An author can abuse this capability by using negative
margin values to create content that overlaps other content. This effect
can be achieved more reliably using properties specified in the
CSS positioning draft.
The design possibilities using overlapping content are enormous -
but understanding the issues
of such constructs is essential.
Use of the CENTER element to center align
text in a block is still recommended slightly over use of DIV because
more older browsers support it. This difference in support is quickly
changing though.
Along the same lines,
HTML 3.2
classifies <center> as a shorthand
notation of <divALIGN="center">. This
effectively makes the CENTER tag a "subset" of DIV.
DTD NOTE: Alignment attributes do not
react very well with the MULTICOL element.
Browser Peculiarities
The 'justify' value of the ALIGN attribute is currently only supported in
Netscape and Internet Explorer, versions 4.0 Beta 2 and above.