help you mold your text and get your message across. HTML also helps structure your document so that your target audience has easy access to your words.
Always keep in mind while designing your documents (here we go again!) that HTML tags, particularly in regard to text, only advise - they do not dictate - how a browser will ultimately render the document. Rendering varies from browser to browser. Don't get too entangled with trying to get just the right look and layout. Your attempts may and probably will be thwarted by the browser.
4.1 Divisions and Paragraphs
Like most text processors, a browser wraps the words it finds in the HTML text to fit the horizontal width of its viewing window. Widen the browser's window and words automatically flow up to fill the wider lines. Squeeze the window and words wrap downwards.
Unlike most text processors, however, HTML uses explicit division (
), paragraph (
), and line-break (
) tags to control the alignment and flow of text. Return characters, although quite useful for readability of the source HTML document, typically are ignored by the browser - HTML
authors must use the
to explicitly force a common text line break. The
tag, while also performing the task, carries with it meaning and effects beyond a simple line break.
The
tag is a little different. Originally codified in the HTML 3.2 standard,
was included in the language to be a simple organizational tool - divide the document into discrete
sections - whose somewhat obtuse meaning meant few authors used it. But recent innovations -
alignment, styles, and the id attribute for document referencing and automation - now let you more distinctly label and thereby define individual sections of your HTML documents, as well as control the alignment and appearance of those sections. These features breathe real life and meaning into the
tag.
By associating an id and a class name with the various sections of your HTML document, each delimited by a
tag and attributes (you can do the same with other tags like
, too), you not only label those divisions for later reference by a hyperlink and for automated processing and management (collect all the bibliography divisions, for instance), but you may also define different, distinct display styles for those portions of your document. For instance, you might define one divisional class for your document's abstract (
, for example), another for the body, a third for the conclusion, and a fourth divisional class for the bibliography (
, for example).
Each class, then, might be given a different display definition in a document-level or externally related style sheet: the abstract indented and in an italic typeface (such as DIV.abstract {leftmargin: +0.5in; fontstyle: italic}); the body in a left-justified roman typeface; the conclusion similar to the abstract; and the bibliography automatically numbered and formatted appropriately.
We provide a detailed description of style sheets, classes, and their applications in Chapter 9,
Cascading Style Sheets.
4.1.1 The
Tag
As defined in the HTML 4.0 standard, the
tag divides your document into separate, distinct sections. It may be used strictly as an organizational tool, without any sort of formatting associated with it; it becomes more effective if you add the id and class attribute to label the division. The
tag may also be combined with the align attribute to control the alignment of whole sections of your document's content in the display, and with the many programmatic "on" attributes for user interaction.
Function:
Defines a block of text
Attributes:
ALIGN ONKEYPRESS
CLASS ONKEYUP
DIR ONMOUSEDOWN
ID ONMOUSEMOVE
LANG ONMOUSEOUT
NOWRAP
ONMOUSEOVER
ONCLICK ONMOUSEUP
ONDBLCLICK STYLE
ONKEYDOWN TITLE
End tag:
; usually omitted
Contains:
body_content
Used in:
block
4.1.1.1 The align attribute
The
Stephen Arseneault
Lenox Hills
Walter Dean Myers
Frances and Richard Lockridge
Andrea Leininger, Bruce Leininger
Brenda Pandos
Josie Walker
Jen Kirkman
Roxy Wilson
Frank Galgay
HTML The Definitive Guide
You must be logged in to Read or Download