Next Previous Contents HTML 4.0 compliance checked by http://validator.w3.org, 
    except demo of LISTING and XMP tags

9.3.1 Paragraphs and Line Breaks

Documents are generally divided into a sequence of paragraphs. The P tag is block level, and hence it terminates any previous block level or inline tags, specifically the preceeding paragraph. Hence the ending tag </P> is rarely seen.

Default alignment. While text alignment is supposed to be handled by CSS styles, the deprecated keyword ALIGN still exists. These paragraphs are justified (aligned) in the default manner for the browser.

Align=left. While text alignment is supposed to be handled by CSS styles, the deprecated keyword ALIGN still exists. This paragraph is justified (aligned) using this keyword. Left alignment is the default for many browsers.

Align=right. While text alignment is supposed to be handled by CSS styles, the deprecated keyword ALIGN still exists. This paragraph is justified (aligned) using this keyword. Right alignment is rarely used for running text; normally for one-line annotations.

Align=center. While text alignment is supposed to be handled by CSS styles, the deprecated keyword ALIGN still exists. This paragraph is justified (aligned) using this keyword. Center alignment is typically used for major section headers.

Align=justify. While text alignment is supposed to be handled by CSS styles, the deprecated keyword ALIGN still exists. This paragraph is justified (aligned) using this keyword. Justification means to adjust the spaces between letters and words so both the left and right ends of each line are lined up vertically. It works a lot better if the browser is able to hyphenate the text. Not all browsers can either justify or hyphenate.

9.3.2: Line breaks can be*
inserted at arbitrary places in the text using the BR tag (there's one at the asterisk). Note that a newline in the source text does not produce a line break in the displayed image.

The nonbreak space has an entity code of &nbsp;. It should appear like a space but is not a line break opportunity. Each sentence in this paragraph has nonbreak spaces between words, but normal spaces between sentences. The browser should either wrap in the middle of a word or should make the sentences hang off the right edge of the window, possibly with scrollbars (how's that for about 180 bytes of run-on sentence, eh?)

9.3.3: Only the most sophisticated browsers hyphenate running text. Here's a pair of paragraphs in which ``soft'' hyphens (entity &shy;) are provided to break up long words. Soft hyphens should not be visible unless they are used at a word break, but then they should be made visible. Plain hyphens (appearing in the chemical names) should always be visible and are not legitimate word break opportunities. Tags are also not legitimate word break opportunities (see the italic letters in the chemical names).

No soft hyphens: Sesquipedalian 4H-1,3-dioxolo[4,5-d]imidazole antidisestablishmentarianism 7H-pirazino[2,3-c]carbazole silicovolcanopneumoconiosis 7H-indolo[3,2-f]quinoxaline. 7H-indolo[3,2-f]quinoxaline silicovolcanopneumoconiosis 7H-pirazino[2,3-c]carbazole antidisestablishmentarianism 4H-1,3-dioxolo[4,5-d]imidazole sesquipedalian.

With soft hyphens: Ses­qui­pedal­ian 4H-1,3-dioxo­lo[4,5-d]imid­azole anti­dis­establish­ment­arian­ism 7H-pir­azino[2,3-c]carb­azole sil­ico­vol­cano­pneu­mo­coni­osis 7H-indo­lo[3,2-f]quin­oxa­line. 7H-indo­lo[3,2-f]quin­oxa­line sil­ico­vol­cano­pneu­mo­coni­osis 7H-pir­azino[2,3-c]carb­azole anti­dis­establish­ment­arian­ism 4H-1,3-dioxo­lo[4,5-d]imid­azole ses­qui­pedal­ian.

9.3.4: The <PRE> tag causes whitespace and newlines in the enclosed text to be displayed as-is by the browser. To preserve column alignment, the material is shown with a monospace font. Tabs skip to tab stops every eight character positions, but the use of tabs is not recomended. <PRE> is inline, and thus needs its own line breaks, which are generally in the preformatted text itself. However, many browsers mistakenly render it as block level.

Beware, however, that one newline immediately after a tag (even <PRE>) or before an end tag such as </PRE> is supposed to be removed, per the SGML specification (ISO 8879 sect. 7.6.1).

Here's the poem from the HTML standard, in which the <PRE> tag is followed by blank, then newline.

 
         Higher still and higher
           From the earth thou springest
         Like a cloud of fire;
           The blue deep thou wingest,
  And singing still dost soar, and soaring ever singest.

And the main text continues here. Each of the five lines is indented differently from the one before it. Shelly, To a Skylark.

PRE is supposed to be inline.

This   sentence   should   be   preformatted.
It should be in monospace font with three blanks between words, but the rest of the paragraph should be normal and particularly should wrap properly. The preformatted sentence should not be in a separate block.

Similar to the PRE tag are two extremely deprecated tags (not even mentioned in the HTML 4.0 specification), LISTING and XMP. In both of them entity translation is not required since the only HTML tags recognized are the end tags </LISTING> or </XMP>. The distinction between them is that a LISTING has an implicit width of 132 bytes while XMP has a width of 80 bytes. Here's a trial of each one. The tag was ignored if only one paragraph per tag was produced.

Test the LISTING tag.

This line is indented four spaces. The text is about forty bytes wide. Bold face? ¢ "Quoted material"? If your browser honors the deprecated LISTING tag, you should see the tags (B in angle brackets), the phrase "ampersand cent semicolon", and the double quotes on the second line. The words should not be in a bold font.

Test the XMP tag.

This line is indented four spaces. <B>Bold face?</B> &cent; "Quoted material"? If your browser honors this deprecated XMP tag, you should see the tags (B in angle brackets), the phrase "ampersand cent semicolon", and the double quotes on the second line. The words should not be in a bold font.

9.4: Insertions and deletions are marked by the INS and DEL tags. As a special case they can be either inline or block level. This sentence is marked with DEL. This sentence is marked by INS. Now here's the same thing with block level content (paragraphs):

This sentence is marked with DEL.

So is this one.

This sentence is marked by INS.

So is this one.

This paragraph is in the default style, neither inserted nor deleted.


15.3: The HR element causes a rule (line) to be drawn horizontally across the canvas. As such, it is really a line break element. There should be a rule above and below this paragraph. The one above should be only half the width of the window and centered.


Next Previous Contents