HTML 4.01 in Netscape and Explorer: Text | WebReference

HTML 4.01 in Netscape and Explorer: Text

nav buttonnav buttonnav buttonnav buttonnav buttonnav buttonnav buttonnav buttonnav buttonnav buttonnav buttonnav buttonnav buttonnav buttonnav buttonnav button

Text Spec
Paragraphs, Lines and Phrases

Whitespace Spec

Both Netscape and Explorer generally support whitespace rules. One exception is that a whitespace immediately after a start tag or before an end tag should be ignored but in these two browsers it is not. Instead, it creates a continuation of the underline for the link. For instance, in the example below, the link is written without any whitespace after the start tag or before the end tag.

  We offer free technical support.

This link has whitespace after the start tag:

  We offer free  technical support.
                ^

Whereas this one has whitespace before the end tag:

  We offer free technical support .
                                 ^

The link is valid but this could cause problems when the link is copied or printed directly from the Web page and used in another situation in which the whitespace is incorporated as a part of the link itself. Obviously, the way to correct this is to write proper code.

Phrase Elements Spec

Phrase elements are rendered by both browsers as equivalent to text-level font style elements:

The abbr and acronym elements work as they are supposed to in Netscape, except that they are rendered with a dotted underline. Explorer only recognizes acronym, but doesn't render its contents in any special way.

Quotations Spec

Both browsers support the blockquote element and render it as an indented block of text. Netscape recognizes the q element and renders it with quotation marks. Explorer also recognizes the q element but does not insert quotation marks to delimit the element's contents, making it rather useless. Neither browser recognizes the cite attribute as used in blockquote elements.

Subscripts and Superscripts Spec

Both browsers support and render correctly the sub and sup elements.

Paragraphs Spec

Paragraphs, and in particular the p element, are one of the most glaring inconsistencies of the HTML implementations in Netscape and Explorer. Essentially, both browsers will consider a <p> start tag to be a double linebreak, though the story is not that simple.

Example 1

Example 1
Example 2

Example 2

If you look at it from the purist's point of view, p elements are rendered correctly with the following exception in Explorer: The space after a paragraph and before the next block-level element is not rendered if you do not include the end tag to the paragraph, unless the next element is a paragraph, a heading, a list, a blockquote, or a pre element. Confused? Let me explain. The following example:

<p>This is a paragraph.
<hr>
<p>This is another paragraph.

is rendered with no blank line between the first p element and the hr element (Example 1), while this example:

<p>This is a paragraph.</p>
<hr>
<p>This is another paragraph.

is rendered with the normal blank line between the p element and the hr element (Example 2).

Netscape places a blank line between the first p element and the hr element with or without an end tag.

Line breaks Spec

The br element is rendered as indicated by the specification, and the &nbsp; character also serves as a way to prohibit line breaks.

Hyphenation Spec

Neither browser supports the semantics of the soft hyphen (&shy;), displaying it as a normal hyphen. Explorer may break a line where it occurs.

Preformatted Text Spec

Both browsers support the pre element. In addition, Netscape supports a cols attribute that specifies the number of columns in the element's contents, and a wrap attribute that indicates that the text should be wrapped at the specified width, or the screen width if the cols attribute is missing. Neither elements are part of the HTML 4.01 specifications. Both user agents render tab characters as tabs to tab stops 8 characters apart.

Document changes Spec

Netscape and Explorer both recognize the ins element, displaying it with an underline. This may cause it to look like a link in some cases. They also recognize the del element, displaying it as struck-through text. Neither browser does anything special with the value of the datetime or cite attributes.

nav buttonnav buttonnav buttonnav buttonnav buttonnav buttonnav buttonnav buttonnav buttonnav buttonnav buttonnav buttonnav buttonnav buttonnav buttonnav button

http://www.internet.com


All Rights Reserved. Legal Notices.
Created: Mar. 12, 1998
Revised: November 15, 2004