HTML Document Divisions
A division, div, element defines a generic document division. Divisions are block elements which can contain text and other elements. In its simplest form a div would be defined as
<div>
...
Text
Child Elements
Text
...
</div>
The most commonly assigned attributes for div elements are
- The
classattribute is discussed here. One can locally alter some aspects of the assigned style by defining an inline style using the codestyle="color:...". Needless to say, only those style attributes that require altering/adding need to be specified. - The
idattribute is discussed here. - The events available across all three browsers - Firefox, Opera and IE - are discussed here.
- The
styleattribute is used to assign inline CSS styling information to the element. The specification takes the formstyle="color:...". Inline styling should be used sparingly to temporarily override CSS attributes inherited from aclassspecification.
Positioning and floating divs are powerful techniques for creating user interfaces with features to rival those created by conventional executable applications. CSS properties which are particularly useful when styling divs are listed below: