Tutorials Bugs Masterclass Free stuff Test pages Proposals

RichInStyle.com bug guide - Netscape 4: Part 2

Bugs - continued

Bugs by type

Part 0 - Core issues - everyone must read

Topics to be found in part 1 of this bug guide

Section A - Bugs relating to the attachment of style to pages ( bugs).

Section B - Bugs relating to the application of style to pages ( bugs).

Section C - Bugs relating to key concepts ( bugs).

Section D - Bugs with units (2 bugs).

Part 1 - Topic related issues - must read if you use the section involved

Section E - Font bugs (22 bugs).

Section F - Text bugs (17 bugs).

Section G - Color and background bugs (12 bugs).


Topics to be found in this part of the bug guide

Section H - Margin and padding bugs (15 bugs).

Section I - Border bugs (24 bugs)

Section J - Other bugs - positioning, display, and width (18 bugs)

Section K - Float and clear bugs (21 bugs).

Part 2 - Element-specific bugs - must read if you use the section involved

Section L - Table bugs (13 bugs)

Section M - Form bugs (10 bugs)

Section N - List item bugs (LI, DD and DT) (19 bugs)

Section O - Horizontal rule bugs (5 bugs)

Part 3 - Error correction bugs - bugs, but inconsequential unless you produce invalid style sheets

Section P - Error correction bugs (42 bugs)

Total bugs = 30 + 2 + 22 + 17 + 12 + 15 + 24 + 18 + 21 + 13 + 10 + 19 + 5 + 42 = 250.


Box model bugs

The bugs here are so many, so serious, and so unpredictable that you should not use Netscape for anything more complicated than simple text layout - e.g., margins on P, H1, etc. Borders are also only usable to do something basic, like giving P a border.

Here is an example, taken from the RichInStyle.com frontpage, of the most complicated sort of thing you should attempt:

H1.main {
border: 40px;
border-color: #f00;
border-style: ridge;
color: black;
background: #fc0;
margin-top: 0; /* I normally have quite large margins on H1 */
margin-left: 0; /* To prevent my usual negative margin */
font-size: 60px; /* N.B. I do not declare line-height on H1 (so the initial value, normal, will work fine), but if you do, there are dozens of bugs to bear in mind */
font-family: "Comic Sans MS", sans-serif;
text-align: center}
<h1 class="main">
  RichInStyle.com
</h1>

Section F - Margin and padding bugs

Bug 1: margins and padding don't work on images

Margins and padding don't work on images.

Bug 2: Unremovable padding/margin on BODY

BODY is automatically given a small margin that cannot be removed.

Bug 3: % on margins and padding

Margins and padding are calculated relative to the width of the viewport, rather than relative to the containing block width. Due to the previous bug, this means that 50% is slightly more than half of BODY's width. Thus, for example:

BODY {margin: 20%;
padding: 0}

DIV.a {float: left;
margin-right: 50%}

DIV.b {
margin-left: 50%}

Would result in a margin-right of 20% + 50% of viewport ≅ 70%, thus giving DIV.a (and DIV.b) width ≅ 30%.

Even worse is the fact that something like this will cause havoc:

DIV.container {
width: 200px
}
DIV.child {
margin-left: 80%
}

This means that you may wish to use browser detection to detect Netscape, or avoid % on margin and padding when the size of the margin is critical..

Vertical margins
Bug 4: margin-top

Setting margin-top in cm, mm, pt, pc or in on any element whatsoever can result in 10 or more blank (save page numbers, times, document locations, etc.) pages when printing.

To avoid this, you must use px, em, % or ex (or thin, thick or medium, in the case of border) if your page's nature is such that it might be printed. However, em and ex are buggy, so you may wish to use only px. This is not such a bad thing as you might think, since using pixels allows you to ensure that the size is proportional to that which is appropriate for your reader's display - 25px will look just as appropriate on 1024 * 678 displays as on 640 * 480 ones. If you are wondering whether to use %, recall that this relates to the width of the containing block on the box model properties, so this is a useful thing to use.

Bug 5: margins on headings, PRE, OL, UL, DL and BLOCKQUOTE

Setting H1 {margin: 0; padding: 0}, which should result in no space around H1, doesn't work - it can only be reduced by the unsafe method (requiring browser detection) of negative margins. The affected elements are:

  1. H1-H6
  2. PRE
  3. OL
  4. UL
  5. DL
  6. BLOCKQUOTE
Bug 6: margin-top doesn't work on inline elements

Margin-top doesn't work on inline elements.

Bug 7: no negative margin-bottom

You can't set margin-bottom to a negative value.

Bug 8: margin-bottom/padding-bottom on inline elements

Margin-bottom set on inline elements will be applied to the containing block rather than to the element itself.

Bug 9: padding-top, padding-bottom

Setting any of these properties in cm, mm, pt, pc or in on any element whatsoever can result in 10 or more blank (save page numbers, times, document locations, etc.) pages when printing.

To avoid this, you must use px, em, % or ex (or thin, thick or medium, in the case of border) if your page's nature is such that it might be printed. However, em and ex are buggy (so is % on line-height), so you may wish to use only px. This is not such a bad thing as you might think, since using pixels allows you to ensure that the size is proportional to that which is appropriate for your reader's display - 25px will look just as appropriate on 1024 * 678 displays as on 640 * 480 ones. If you are wondering whether to use %, recall that this relates to the width of the containing block on the box model properties, so this is a useful thing to use.

Collapsing of margins
Bug 10: not correctly collapsed with 2 negative margins

Although Netscape correctly handles the situation where both the margin-top and margin-bottom are positive, it fails to handle negative margins correctly, adding the two together where both are negative instead of applying the most negative of the two as the CSS spec states.

Bug 11: only collapsed between margin-top and margin-bottom

Netscape fails to collapse adjoining margin-tops or margin-bottoms, only collapsing between a margin-top and margin-bottom. This will result in excessive space between such margins.

Horizontal margins and padding
Bug 12: Margin-left on OL, UL, and BLOCKQUOTE and margin-right on BLOCKQUOTE

Margin-left on OL, UL and BLOCKQUOTE and margin-right on BLOCKQUOTE are interpreted relative to the element default, rather than to the left of the containing block. This means that you should either avoid setting margin-left and margin-right on these elements, or use browser detection and deduct the appropriate amount for Netscape.

Bug 13: margin-left, margin-right /padding on inline elements

Setting either of these results in the element being thrown that far in the direction specified, and overlapping thus results. The margin is interpreted as position: relative with an offset equal to the margin specified. Thus avoid like the plague.

Bug 14: auto

Auto is interpreted as 0.

Bug 15: negative margin-right

Margin-right cannot be set to a negative value.


Section G - Border bugs

Border concepts
Border styles
Bug 1: border-style: hidden

Netscape cannot parse to save its life, and as a result it interprets border-style: hidden as outset.

Bug 2: border-style: dotted

The dotted border style is applied as solid.

Bug 3: border-style: dashed

The dashed border style is applied as solid.

Bug 4: only one style applied

Although the CSS specification permits up to four styles on border-style, Netscape only uses the first one.

Bug 5: border-style: double three times too big

Although double borders should result in a border whose total width, including space between borders is equal to border-width, the total width in Netscape will instead be three times border width.

Border colors
Bug 6: only one color applied

The CSS spec states that up to four colors can be specified for border-color, but Netscape only applies the first one.

Bug 7: initially black

Border-color's initial value is the element color. Netscape ignores this and always applies black. If background-color: black, this will make the border invisible, so you should always set border-color.

Padding inside elements with borders
Bug 8: added without being told to do so

Some elements with borders are given a small amount of padding inside the border. This is given the color of the parent element. This 'pseudo-padding' cannot be suppressed.

Bug 9: background not applied to pseudo-padding

Backgrounds are not applied to the 'pseudo-padding' (see also above). The means you can't apply backgrounds to empty boxes.

Bugs relating to border widths
Bug 10: border-style: solid initial value, border-width: medium initial value

Setting border-style to solid should result in a medium sized border, since medium is the initial value of border-width. In Netscape this is not the case. Thus instead of the initial values being border-style: none, border-width: medium, the initial values are border-style: solid, border-width: 0. This is easy to correct, however, simply by always setting both border-style and border-width.

Bug 11: borders when printing

Setting any border properties in cm, mm, pt, pc or in on any element whatsoever can result in 10 or more blank (save page numbers, times, document locations, etc.) pages when printing.

To avoid this, you must use px, em, %, ex, thin, thick or medium if your page's nature is such that it might be printed. However, em and ex are buggy, so you might only wish to use px. This is not as bad a thing as you might think, since using pixels allows you to ensure that the size is proportional to that which is appropriate for your reader's display - 25px will look just as appropriate on 1024 * 678 displays as on 640 * 480 ones. If you are wondering whether to use %, recall that this relates to the width of the containing block on the box model properties, so this is a useful thing to use.

Bug 12: Borders are buggy on BODY

Where BODY is given a border, it is only drawn around the whole of its content rather than BODY itself. E.g.:

BODY {border: solid thin}
P {width: 200px}
/* BODY's border would be 200px wide! (instead of going across the whole screen) */

Bug 13: background-color: transparent on elements with borders

If background-color is explicitly set to transparent on elements with borders, the element is given a black background color. So don't do it.

Bug 14: borders are unusable on inline elements

Setting borders on inline elements results in a line break before and after the element, thus rendering them unusable. Note that this even includes specifying border: none.

Bug 15: borders are unusable on images

Setting a border on an image results in the image being displaced, a border being drawn around empty space, and thus generally making borders unusable. Note that this even includes specifying border: none.

Bug 16: PRE and borders

Giving PRE a border stops it being a preformatted element, unless you add white-space: pre.

Bug 17: borders and elements with white-space: pre

Setting white-space: pre results in the suppression of borders elements with white-space: pre, EXCEPT PRE with white-space explicitly set to pre, thus meaning that on other elements you have a choice between the preformatting and the border.

Bug 18: Elements with borders inside lists

Under certain circumstances, elements with borders inside lists will behave like TABLEs and not inherit style. To see an example of this, click here. This means that I would reiterate my advice above that you add every block element (inline elements do not need it because of inheritance from their blocks (providing you keep all inline elements inside block elements)) to the BODY selector, as with the example above. E.g.:

BODY, ADDRESS, P, DIV, TD, TH, H1, H2, H3, H4, H5, H6, SPAN {
/*
all the properties you want to inherit from BODY go here.
Note this should be the first line of the style sheet, so that subsequent declarations can override it.
*/
}

Bug 19: percentage widths not related to containing block width

Netscape relates border widths in percentages (a vital extension to CSS) to the width of the viewport rather than that of the containing block.

Bug 20: successive unclosed P elements with borders crash browser

If you have successive unclosed P elements with borders, the browser will crash; for example, <P style="border: solid medium"><P style="border: solid medium"> will crash the browser.

Border-left
Bug 21: unsupported

Netscape doesn't support the border-left shorthand.

Border-right
Bug 22: unsupported

Netscape doesn't support the border-right shorthand.

Border-top
Bug 23: unsupported

Netscape doesn't support the border-top shorthand.

Border-bottom
Bug 24: unsupported

Netscape doesn't support the border-bottom shorthand.


Section H - Other bugs (positioning and width)

height
Bug 1: unsupported

Netscape doesn't support height.

width
Bug 2: destroyed in lengths

Setting this property in cm, mm, pt, pc or in on any element whatsoever can result in 10 or more blank (save page numbers, times, document locations, etc.) pages when printing.

To avoid this, you must use px, em, % or ex (or thin, thick or medium, in the case of border) if your page's nature is such that it might be printed. However, em and ex are buggy (so is % on line-height), so you may wish to use only px. This is not such a bad thing as you might think, since using pixels allows you to ensure that the size is proportional to that which is appropriate for your reader's display - 25px will look just as appropriate on 1024 * 678 displays as on 640 * 480 ones. If you are wondering whether to use %, recall that this relates to the width of the containing block on the box model properties, so this is a useful thing to use.

Bug 3: %

% on width should relate to the width of the containing block. In Netscape 4, however, they relate to something else, which seems to be the length of a piece string. This makes % unusable (without specific testing in Netscape). However:

BODY {
width: 90%;
}
/* According to the CSS spec this would result in a margin-left of 0 and a margin-right of 10%. So change it to: */
BODY {
margin-left: 0;
margin-right: 10%
}
/* Which _will_ work, implying the required width. This is so for all elements. */

Bug 4: doesn't work on IMG

Width doesn't work on replaced elements.

Bug 5: can't make element go outside a border

It is not possible to use width to make an element go outside its containing block if that block has a border. This wouldn't work:

DIV {
width: 200px;
border: solid thin;
}
P {
width: 400px;
}
<DIV>
  <P>
  </P>
</DIV>

Nor is it possible to use margin-right to make it work, since Netscape doesn't support negative margin-right.

Bug 6: can't overflow viewport

It is not possible to use width to make elements (including BODY) exceed the width of the viewport.

position
Bug 7: Child elements of relatively positioned elements

Where a relatively positioned element has block level child elements, it causes an unsightly increase to margin-bottom, unless the closing tag is omitted. E.g.:

DIV.x { position: relative; }
<DIV class="x">
  <P>
    Hello   
</P>
</DIV>

This would cause an extra margin-bottom (as would any child block level element), unless the closing tag is omitted. However, of block elements it is only possible to omit P's closing tag.

Bug 8: Absolute positioning of A

If you position A absolutely , it is literally impossible to click on it, thus A should not be absolutely positioned.

Bug 9: borders buggy

Borders only work on absolutely positioned elements when the element is at least one line long.

Bug 10: backgrounds on absolutely positioned elements

Only the space behind the text is given a background-color (b-image works fine) on absolutely positioned elements. To fix this, add the Netscape specific layer-background-color property, which should be set to the same value.

top
Bug 11: relates to height of viewport

% on top are interpreted as relative to the height of the viewport on absolutely positioned elements, not the height of the root element as they should be.

display
Bug 12: block

Nested elements with display: block crash some versions of Netscape, and as such, doing this should be avoided.

Bug 13: block

Netscape only creates line breaks before display: block elements, not after, so, e.g.,:

<div>
the cat
<span style="display: block">
sat
</span>
on the mat.
<span style="display: block">
and the dog </div>

Would be rendered as:

the cat
sat on the mat
and the dog

Instead of

the cat
sat
on the mat
and the dog

Bug 14: inline

If used on elements other than P, such as DIV, overlapping is likely to occur.

Bug 15: inline

This doesn't work unless the element's closing tag is omitted - a closing tag causes the line break.

overflow
Bug 16: scroll destroyed

Overflow: scroll is rendered as overflow: hidden, which is very bad.

clip
Bug 17: buggy

Clip is buggy, and is to be avoided without prior testing.

z-index
Bug 18: doesn't work on images

Z-index doesn't work on images, only on text.


Section I - float and clear bugs

All inline elements
Bug 1: Inline elements

The following two pieces of code are equivalent:

<P>
  <SPAN style="float: left; width: 1em">P</SPAN>arrot.
</P>

<P>
  arrot.<SPAN style="float: left; width: 1em">P</SPAN>
</P>

Netscape on the other hand moves floating inline elements that are not the first thing on their lines down to the next line (which may well not exist, thus causing an undesired line feed). This makes float unusable for letters that are not the first thing on their line (the same thing applies for float: right as float: left, which is rather inconvenient, since this is the logical place to put right floated inline elements).

Bug 2: Width ignored on floating inline elements.

Width is not honored on floating inline elements, instead Netscape prefers to allocate the width that the content requires.

Bug 3: floats extend containing block

Floats won't float out of their containing block. For example, if you float an image, rather than being taken out of normal flow and therefore being allowed to continue out of its block, it will cause the containing block to be extended so that it fits within it.

Inline text elements only
Bug 4: The height of the box in which inline text exist is too big.

If you try float: left on inline text (e.g., drop caps), you will find that the box that the letter sits in (unalterable) is so big and thus ugly as to be unusable. This means I would avoid using float on inline text.

Bug 5: Alignment of floating text

According to the CSS specification, the top of a floating box should be aligned with the top of the line. This makes <P><SPAN style="float: left">H</SPAN>ello</P> indistinguishable from <P>Hello</P>. Netscape fails to do this, aligning the middles of the respective boxes, which, combined with its bug of increasing the size of floating boxes makes float useless on inline text.

Bug 6: Line-height is buggy on floating text

Try this:

<P>
  <SPAN style="float: left; line-height: 1in">H</SPAN>ello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello.

This should result in a one inch high 'H' block, the top of which is aligned with the top of the rest of the line. What it does instead is apply the inch of line-height to the top of the block as a margin-top. Equally, line-height: 0 sets margin-top: 0, though not overriding any margin-top on P (i.e. line-height: 0 only sets margin-top: 0 if margin-top is not set). Thus line-height should be avoided on floating text.

Bug 7: Margins are unusable on floating text

If you set margins on floating text, it is applied to the containing block rather than to the float itself. This makes margin useless on floating text.

Bug 8: font-size might 'inherit' from drop cap to block

Under certain (unknown) circumstances, properties will 'inherit' from the drop cap to the block. This tends to ruin the page.

Bug 9: floats must be the first thing in their line

If you float something from a line box, if is not the first thing in its line box, it will be moved down to the next line down.

Bug 10: text-align doesn't work on inline floats

Netscape does not let text-align work on inline floats. For example, <SPAN style="float: right; text-align: right; width: 4em">, which uses the text-align to counteract the effect of the width (required by the specification (and advisable to set too large)), would not take into account the text-align: right (valid on).

Block elements

Most people will be surprised to find that is possible to get float to work almost perfectly on block elements - 99% of all the bugs are actually caused by the bug with % on width.

DIV.a {
float: left;
margin-left: 0;
margin-right: 50%;
}
DIV.b {
margin-left: 50%;
margin-right: 0;
}
/* This works! E.g.:
<DIV class="a">
  Hello
</DIV>
<DIV class="b">
  Hello
</DIV>
*/
/* Note that this will not work in compliant CSS UAs, so you will have to use browser detection */

Bug 11: Floating elements next to floating elements

Where a floating element is placed next to another left floating one, the result is an unreversable negative left margin on the right floated element. This causes unreadable pages as a result of the overlap. Thus if you added float: right (or float: left) to DIV.b, above, this would be the result.

This prevents more than two columns being used.

The best you can do is this:

DIV.a {float: left;
margin-left: 0;
margin-right: 50%;
}
DIV.b {margin-left: 50%;
margin-right: 50%}
<DIV class="a">
  Some identical text that is long enough to fill the line.
</DIV>
<DIV class="b">
  Some identical text that is long enough to fill the line.
</DIV>

You will find that the vertical alignment is slightly wrong. This will not cause major problems, but you should test before attempting to use float.

Bug 12: Floating block elements' margins are interpreted relative to the left of the containing block

E.g.:

DIV.a { float: left;
margin-left: 0;
margin-right: 50%}
DIV.b {
/*
Should float to the right of it, but instead overlaps it.
This means that you must include margin-left and right relative to the left and right of the containing block, as in my example above. It also makes negative margins unusable.
*/
}

Alternatively, you could specify the width in pixels/cm/in/mm. This will work. E.g.:

DIV.a {float: left;
width: 350px}
DIV.b {width: 350px}

Bug 13: Font-size: larger

If set on elements going round a right floating element, it causes the font-size to be such as to make the element the same size as the right floating element. E.g.:

DIV.left {font-size: larger; /* Won't work - is interpreted as the font needed to make height the same as DIV.right */
font-size: 16pt; /* _Will_ work, as would the total omission of font-size or font-size: smaller */
/* width: 67%; */
margin-right: 33%}
DIV.right {padding: 2%;
margin: 2%;
margin-left: 69%; /* width of left of 67 + 2 for margin-left of this one */
float: right;
/* width: 25%; */}
with
<DIV class="right">
</DIV>
<DIV class="left">
</DIV>

Bug 14: Font-size on floating elements

If you changed the above code to

DIV.left {float: left;
font-size: anyvalue; /* Will be ignored */
font-size: 16pt; /* _Will_ work, as would the total omission of font-size or font-size: smaller */
margin-right: 33%}

DIV.right {padding: 2%;
margin: 2%;
margin-left: 69%; /* width of left of 67 + 2 for margin-left of this one */ /*
width: 25%; */} <DIV class="left">
</DIV>
<DIV class="right">
</DIV>

Font-size won't work on floating block elements at all.

Bug 15: Floating elements where the combined width exceeds the viewport width

Where the two widths (as in DIV.a and DIV.b) exceed the viewport width, the bottom (not the right!) of the left element is cut off. This makes the use of pixels and lengths impracticable, since it is not possible to predict the viewport width.

Bug 16: Alignment of the first line of an element next to a float

Where an element is to the right a float, its first line might overlap slightly. As a result, you may wish to add a little padding, or a few non breaking spaces to the first line of the element. E.g.:

<DIV class="leftfloat">
</DIV>
<DIV class="nexttoit">
&nbsp;&nbsp;&nbsp;
</DIV>

Bug 17: Clear and float set on the same element

If you set clear and float on the same element, then a crash will result in Mac Netscape.

Bug 18: marker box of floated list items placed relative to left of content, not left of element

Netscape floats its marker box relative to the left of its content, not the left of the element.

Bug 19: non-floated elements that overlap with floated ones cause the shape of the block element to be affected

Where non-floated elements overlap with floated ones, rather than simply overlapping, they cause the shape of the block element to be affected. For example:

<DIV style="float: left; width: 20%; line-height: 20px; font-size: 16px; background: red"> A run-in heading </div> <DIV style="background: blue; line-height: 20px; font-size: 16px"> And some text, which will flow around it in a pleasing way. Isn't that wonderful? And some text, which will flow around it in a pleasing way. Isn't that wonderful? And some text, which will flow around it in a pleasing way. Isn't that wonderful? </div>

This would cause the following rendering:

A run-in heading And some text, which will flow around it in a pleasing way. Isn't that
wonderful? And some text, which will flow around it in a pleasing way. Isn't that wonderful? And some text, which
will flow around it in a pleasing way. Isn't that wonderful?

Rather than this correct one:

A run-in heading And some text, which will flow around it in a pleasing way. Isn't that
wonderful? And some text, which will flow around it in a pleasing way. Isn't that wonderful? And some text, which will flow around it in a pleasing way. Isn't that wonderful?
Bug 20: horizontal rules shortened where they overlap with floats

Although horizontal rules, as borders, should overlap with floats, Netscape shortens them to stop this happening.

Bug 21: clear badly broken

Clear does not work properly - sometimes it moves the element down and to the right, at others just down.

Information regarding % on width and regarding margins

I have stated that width: % is generally buggy, and indeed this is true with float. If you use width in % on float, the page will be an unreadable mess.

In addition, note that where you specify a margin-left or margin-right in Netscape, Netscape places the element that far from the left of the BODY. This means that you should use padding instead of margin, unless you intend to use the margin to simulate width.

You cannot have negative margin-right and margin bottom in Netscape 4. This is significant because of the width bug.


Part 2 - Element-specific bugs

Section J - Table bugs

Bug 1: TD and TH

Style does not ever, under any circumstances, inherit into TD and TH.

The styles that are affected are all those that are inherited, including: the font properties, color:, line-height, text-align.

The way to fix this is to take the BODY declaration and separate it into inherited and non-inherited styles. For example:

BODY {margin: 5%;
line-height: 20px;
color: green;
padding: 5%;
background: red url(back.jpg);
font: 16px Verdana, sans-serif}

Becomes:

BODY {margin: 5%;
padding: 5%;
background: red url(back.jpg)}
BODY {line-height: 20px;
font: 16px Verdana, sans-serif;
color: green}

Next, add TD and TH to the inherited BODY declaration.

BODY, TD, TH {line-height: 20px
font: 16px Verdana, sans-serif;
color: green}

Follow this procedure for ALL declarations for elements that contain or might contain TABLEs.

E.g.:

BODY.class {color: blue}
Becomes:
BODY.class, TD, TH {color: blue}

DIV, OL, UL {line-height: 20px}
Becomes (because DIV/OL/UL might contain TABLEs):
DIV TD, DIV TH, OL TD, UL TD, OL TH, UL TH {line-height: 20px}

Bug 2: Borderless TABLEs inside elements with borders

Where a TABLE with its HTML border="0" is inside an element with a border, it automatically has its own border set.

Bug 3: Tables and background color

When a TABLE is set by any method to have a background color, and TD or TH have a font-family declaration that is precisely the same as that of BODY (as they will do if you use the method above and you set font-family), TD may be given BODY's background color if BODY's is #000000 instead of TABLE's. E.g.:

BODY, TD, TH {font-family: Arial}
Or
BODY {font-family: Arial}
TD {font-family: Arial}
With
BODY {background-color: #000000}
TABLE {background-color: y}

There are two solutions:

BODY {background-color: #010000} /* Unnoticeable amount */
Or
TD {font-family: madeup, "Actual Font"}
/* Where Actual Font is the one you really want */

Note that this bug is very rare.

Bug 4: borders don't work

Borders can't be applied to TABLEs.

Bug 5: TD and TH

After TD and TH elements, some of the time, all inherited properties are lost. This means that you must add every single block tag to the TD, TH and BODY above. In addition, where a TABLE is in a LI (or any situation where TABLE is not followed by a block level tag), because of the bug whereby properties applied to LI, DD and DT are applied only to the marker and not to the content, this won't work. Thus I would recommend that you follow every TABLE with a SPAN or a block element, and add this to the selector. E.g.:

BODY, DIV, TD, TH, P, OL, UL, DL, DD, DT, H1, H2, H3, BLOCKQUOTE, H4, H5, H6, ADDRESS, SPAN {
all inherited properties go here
}

Bug 6: Padding on TABLEs

Padding is applied to TD and TH as well as to TABLE. This means you should not apply padding to TABLE, although applying it to TD and TH works fine.

Bug 7: padding on TR and TD

Padding is completely broken on TR, TD and TH and should not be used.

Bug 8: contextual selectors that include TABLE or TR don't work

Contextual selectors do not work if they include TABLE or TR or refer to a TABLE or TR; for example, TABLE TD won't work.

Bug 9: background images unsupported on tables and table rows

Netscape does not support background images on tables or table rows.

Bug 10: unclosed TRs inherit margin

If you do not close the last TR in a TABLE, it will inherit the table's margin into the rest of the document.

Bug 11: text-align allowed to affect TABLEs

Netscape allows text-align to affect the position TABLEs. This is wrong because TABLEs are block boxes, and text-align only affects inline content.

Bug 12: width doesn't work on table elements

Netscape doesn't let width work on table elements.

Position
Bug 13: crashes

If you position tables, or elements that contain them, a crash will result in earlier versions of Netscape (I have experienced it in 4.04).


Section K - Form bugs

Bug 1: enclosure of FORM elements in P

If you enclose FORM elements in P, each /p will be interpret as /container. E.g.,:

<form>
<p>
<input type="text"> <!-- or any other form element -->
</p> <!-- /container = /form -->
<p>
<input type="text"> <!-- or any other form element -->
</p> <!-- /container = /body -->
</form>

The consequences of this are very serious; for example, if you close the FORM then the form controls won't work properly (e.g., they won't be sent to your form processor); if you close the BODY then the margins and any other properties of the BODY will be lost.

As a result, you should either use DIV, or omit the end /p.

Note: Background-color

The background-color bug (i.e., only coloring behind the text) applies to FORM, but the border: none workaround also works.

Bug 2: backgrounds applied in a glitchy way on INPUT type="radio"

Netscape applies backgrounds on INPUT type="radio" in a mildy glitchy way, coloring the square that the button is circumscribed within, but not the button itself.

Bug 3: Style on form elements

The only styles that are applied to form elements are font-size, font-style, font-weight, font-family, text-decoration margin and padding [margin and padding are buggy on inline elements anyway - see above, so therefore are completely broken on forms as well] properties - not color or background.

Note that when I refer to form elements, I mean all form elements except for FORM itself - FORM {background-image: whatever} works, but INPUT {background-image: whatever} does not.

Bug 4: line-height transforms SELECT and OPTION to block elements

Line-height transforms SELECT and OPTION into block elements.

Bug 5: Borders on INPUT

These are badly bugged, being drawn on the line below the element.

Bug 6: Borders on TEXTAREA

These are badly bugged, destroying the TEXTAREA so that it is no longer a TEXTAREA (i.e., can't be typed in).

Bug 7: Borders on SELECT and OPTION

These are badly bugged, destroying the SELECT/OPTION and displaying garbage.

Bug 8: font and text properties on TEXTAREA, OPTION and SELECT

These don't work unless the TEXTAREA or OPTION (NB not SELECT) is enclosed in a SPAN (or DIV if you want a block element) and the style applied to that.

Bug 9: white-space doesn't work

White-space: normal doesn't work on TEXTAREA.

Bug 10: text-align doesn't work on TEXTAREA

Text-align doesn't work to move the contents of TEXTAREA.

Bug 11: allowing line-height to inherit into form elements

If you allow line-height to inherit into form elements, you will experience problems with overlapping elements. The problems are only midly annoying on buttons or text fields created by the INPUT element, but very serious on TEXTAREA, which will be destroyed if you allow line-height to inherit into it.

Apart from not specifying line-height at all, a useful workaround is to specify line-height: normal on elements that contain form controls. For example, this is the code used on RichInStyle.com's front page to prevent this:

<DIV style="line-height/* */ : normal"> <TEXTAREA cols=50 rows=30> </DIV>

Note, incidentally, the /* */ after the line-height. This hides the declaration from Microsoft Internet Explorer, which, in version 3, will treat that declaration as line-height: 0, and means that other versions aren't forced not to use the line-height.

Width

This works fine.


Section L - List item bugs (LI, DD, DT)

Bug 1: destroys

If you set properties on LI, DD, DT, as in LI {font-family: Arial} or UL LI {color: blue} they are only applied to the marker, and not the content. DD and DT don't have markers, but are treated in the same way, so there is no effect at all.

This means you should declare on OL, DL and UL instead, and rely on inheritance.

The only thing that this bug prevents is the application of different styles to DD and DT.

Bug 2: font-size on LI

Where font-size is applied to LI, and hence the list item marker is made larger (N.B., not the text - see the bug above, the marker-offset is not increased. As a result, if the font-size is big enough, overlapping will result.

Bug 3: padding-bottom and margin-bottom on DT

These are buggily applied as padding-top (if padding-top worked) instead, making them unusable.

Note that these wouldn't work anyway, due to the bug whereby style is applied to the marker and not the content, but this bug is included in case you use the same style sheet for Netscape and other browsers.

Bug 4: borders on LI, DD and DT

These should be avoided like the plague, because what they do is have a border round a single empty space, followed by a <BR> before the element content with the whole thing misaligned with the list marker.

Note that these wouldn't work anyway, due to the bug whereby style is applied to the marker and not the content, but this bug is included in case you use the same style sheet for Netscape and other browsers.

Bug 5: line-height on LI

Where line-height is applied to LI (note that this wouldn't work any way - see above), the whole line-height is applied to the top of the OL/UL, and not to the LI. Thus you must not use line-height on LI. However:

LI {line-height: 18pt}
Is equivalent to (because of inheritance):
OL, UL {line-height: 18pt}
Thus all you need to do is change LI line-height declarations to OL and UL ones!

Bug 6: margin-top and padding-top on LI and DT

Margin-top and padding-top are buggily added to the OL/UL/DL margin-top rather than to the LI/DT itself, thus making margin-top and margin-top unusable on LI, and DT. Thus:

OL {margin-top: 1in}
LI {margin-top: 1in}
/* OL would have a 2 inch margin-top, and LI none at all */

Note that these wouldn't work anyway, due to the bug whereby style is applied to the marker and not the content, but this bug is included in case you use the same style sheet for Netscape and other browsers.

Bug 7: margin-bottom and padding-bottom on LI

Margin-bottom and padding-bottom are buggily applied to the content but not the marker. This causes the marker and content not to be lined up. Thus margin-top and margin-bottom are both unusable and should be avoided at all costs on LI.

Note that these wouldn't work anyway, due to the bug whereby style is applied to the marker and not the content, but this bug is included in case you use the same style sheet for Netscape and other browsers.

Bug 8: padding-left, margin-left, margin-right and padding-right on LI

If you set padding-left, margin-left, margin-right or padding-right on LI, the list item is suppressed. This makes them unusable.

Note that these wouldn't work anyway, due to the bug whereby style is applied to the marker and not the content, but this bug is included in case you use the same style sheet for Netscape and other browsers.

Bug 9: margin-left, padding-right, margin-right and padding-left on DT

These are buggily not applied to the first DT in a DL, making them unusable.

Note that these wouldn't work anyway, due to the bug whereby style is applied to the marker and not the content, but this bug is included in case you use the same style sheet for Netscape and other browsers.

Bug 10: margin-left, margin-right, padding-right and padding-left on DD

Setting these doesn't work, and results in margin-left: 0; padding-left: 0.

Note that these wouldn't work anyway, due to the bug whereby style is applied to the marker and not the content, but this bug is included in case you use the same style sheet for Netscape and other browsers.

Bug 11: text-align allowed to affect list markers

Netscape allows text-align to affect the position of list markers. This is wrong because list markers are positioned relative to the border edge of the element, and the border edge's position isn't affected by text-align.

Bug 12: text-indent allowed to affect list markers

Netscape allows text-indent to affect the position of list markers. This is wrong because list markers are positioned relative to the border edge of the element, and the border edge's position isn't affected by text-indent.

Bug 13: list-item destroyed

Display: list-item is interpreted as display: block, margin-left: (OL's margin) but no list-items are drawn

list-style-type
Bug 14: the none list type

If list-style-type is set to none on OL or UL, and either margin or padding or both is also set, the list-style-type is set to disc (even on OL). This does not apply to LI, because their bugs override OL's/UL's.

Bug 15: lower-alpha, upper-alpha, lower-roman, upper-roman, decimal

The marker glyphs on these list-style-types are followed by '.', which is wrong according to the CSS specification.

Bug 16: lower-roman, upper-roman, decimal, lower-alpha, upper-alpha on UL list items

If a LI is part of an unordered list, the lower-roman, upper-roman, decimal, lower-alpha and upper-alpha list-style types result in list-style-type: circle.

Bug 17: square, disc, circle

If a LI is part of an ordered list, the square, circle and disc list-style types result in list-style-type: decimal.

list-style-position
Bug 18: doesn't work

List-style-position doesn't work.

list-style-image
Bug 19: doesn't work

List-style-position doesn't work.


Section M - Horizontal rules

Bug 1: can't be colored

There is no way to change the color of HR.

Bug 2: Border on HR

Setting a border on HR screws it up, drawing a tiny box above and below the rule rather than doing what it should do, which is to draw a border round the rule.

Bug 3: horizontal padding allowed to affect HR

Netscape allows horizontal padding to affect HR, which is wrong because HR is a border and padding is applied inside the border.

Bug 4: top padding applied as margin

Vertical padding on HR, which should be applied inside the HR, is instead applied as a vertical margin outside the HR.

Bug 5: text-align allowed to affect HR

Netscape allows text-align to affect the alignment of HR. This is wrong because it should have no effect - text-align only affects inline content - not borders.


Part 4 - Error correction bugs

Section N - Error correction bugs

  1. Float is buggily (and illegally) applied to positioned elements
  2. Text-indent is (illegally) applied to inline elements.
  3. White-space is (illegally) applied to inline elements.
  4. Text-align is illegally applied to elements other than block elements, affecting the whole of the block.
  5. Width is buggily (and illegally) applied to non-block elements.
  6. Float: center is applied as per text-align: center, but it isn't a valid value.
  7. Negative line heights are illegal, but Netscape applies them.
  8. Display: list-item is illegally (and buggily - without a list item!) applied to floating elements.
  9. Display: list-item is illegally (and buggily - without a list item!) applied to absolutely positioned elements.
  10. Selectors containing invalid selectors do not always cause the ruleset to be ignored: e.g., P, H1 & H2
  11. Although it is legal for selectors to contain Unicode characters 161 and above, they may not start with them unless escaped. Netscape allows this.
  12. Spaces between the value and the length should result in the property and value being ignored. Netscape fails to comply with this.
  13. Colors that don't include the # are rendered.
  14. Netscape will ignore the whole selector when any other than the first simple selector is whitespace (which is valid from the definition of simple_selector), e.g., P, {color: red}. It does not ignore ,P {color: red} - it must be the last thing to ignore it. This could be useful for excluding Netscape.
  15. Netscape allows quoted font-family keywords, but this isn't valid
  16. Netscape treats unquoted font names that include white space as though the white space were there, but it shouldn't - the white space should be collapsed - e.g., Courier New to CourierNew
  17. Netscape will have problems with any future @rules that occur inside rulesets.
  18. Where simple_selector includes a class, and element_name is unknown to Netscape, it ignores element_name, e.g., applying dog.class as .class
  19. Netscape parses all unknown dimensions as px on longhand box model properties, but correctly ignores them on font properties and shorthands.
  20. Netscape applies styles to selectors enclosed in < >, but this isn't valid
  21. Netscape allows list-style-type: disk (as disc), but this isn't a valid value
  22. Netscape allows non-integer values in the decimal rgb format, but this isn't valid.
  23. Netscape allows non-integer values in the percentage rgb format, but this isn't valid.
  24. Netscape doesn't support all text-decoration values (not overline), so it needed to cater for this. However, rather than recognising, but not applying, the unsupported value, it goes for the shoddy sloppy-programming approach of not checking any value. As a result, text-decoration: underline cheese-burger, which should be ignored, will be rendered as underline.
  25. Netscape applies all preferred style sheets as persistent; this is not a serious bug because preferred style sheet support implies alternate style sheet support, which Netscape lacks; furthermore, it is a mistake to include more than two style sheets with the same title in a document anyway.
  26. Netscape treats the media attribute as case-insensitive. It is not.
  27. Netscape does not truncate media values; for example, "screen 493274092370ew f9osdfhbnsdfn 23184e098i12&$&*W$^£$^~@D:S~D:S}D:WED}{QENQWD|Wz" should be truncated to screen, but Netscape only supports exact matches.
  28. Netscape fails to treat the first instance of '</' as terminating the STYLE block.
  29. Netscape will apply classes or IDs that have a space between the DELIM and IDENT.
  30. It allows character references in IDs, but they aren't valid here (only in classes).
  31. Very long classes or IDs (several k) cause JavaScript errors.
  32. Extremely long classes or IDs (several tens of k) crash the browser.
  33. Invalid IDs often cause JavaScript errors; this is wrong because they should simply be IGNOREd.
  34. It fails to ignore most invalid declarations; for example, it will render background: url(green.gif) autumnmagnolia.
  35. It doesn't ignore invalid declarations - when it can't render a value, it resets the property to its initial value instead of ignoring it.
  36. It allows comma-separated margins.
  37. It ignores the case of proprietary font names.
  38. It allows comments between 'rgb' and (, which is invalid because rgb( is a single token.
  39. It will ignore pages that have unclosed CDOs (e.g., <!--) inside the STYLE element. This is incorrect because to a CSS-aware browser the <!-- is not a comment but merely a bit of fluff - much like whitespace.
  40. It allows font weights that don't divide by 100.
  41. It allows font declarations that include a line height with the / preceded or followed by whitespace.
  42. It allows percentages on positioning even when the height of the containing block is unknown.

Information

Font-size: larger and smaller

Larger and smaller on font-size are applied as 1.6* as large.

Multiple classes

This is not a bug, but CSS 2 (though not CSS 1) allows an element to have more than one class, as in class="class1 class2". Netscape ignores entirely all such elements. If you have <ELEMENT class="class1" class="class2">, then Netscape deems the element only to have class2.

CSS 2 also allows elements to be :link/:visited as well as :active (e.g., A:active:link). Netscape will ignore all such declarations.