Home ~ ToC ~ Index ~ Refs ~ Feedback Known CSS Implementation Bugs
Last Modified: 31 December 1997

Problems with Vertical Margin Properties

Platforms Demonstrating Problem

Netscape Navigator 4 (all platforms)

Description of Problem

The CSS declarations {margin-top: 0; margin-bottom: 0} should set zero-width margins above and below an element. Unfortunately, Netscape does not set true zero-height margins for those HTML elements that have default nonzero margins -- typical examples are the heading elemnts H1 -- H6, BLOCKQUOTE, or P. In these cases, Netscape Navigator 4 adds the margin property values onto the default nonzero margin values. This makes it almost impossible to user vertical margins to position elements, since the positioning will be done differently on INternet Explorer 4 and Netscape Navigator 4.

Internet Explorer 4 implements vertical margins properly.

Proposed Workaround

Use DIV elements for text blocks you wish to position vertically: DIV has zero-width default margins, and can as a result will be consistently positioned on Netscape Navigator 4 and Internet Explorer 4.


Prepared by: Ian Graham Known CSS Implementation Bugs
Last Modified: 31 December 1997