W3C home > Mailing lists > Public > www-style@w3.org > January 1998

Conflict resolution between width and margin properties

From: Todd Fahrner <fahrner@pobox.com>
Date: Tue, 13 Jan 1998 10:30:29 -0800
Message-Id: <199801131801.KAA06781@mail-gw.pacbell.net>
To: www-style@w3.org
There's a discrepancy between the ways NS4 and IE4 handle the following
situation, and I don't know which is correct - does anybody? The case:

Suppose I have a textual element set to be 36em wide (to keep lines from
running too long based on the font size). In addition to setting a width, I
specify left and right margins of 16% and 8%, respectively. 

In NS4, this behaves nicely (except the em unit is incorrectly large, and
the percentage reckoning doesn't start at the window edge but the "body
offset edge"). When the window is very wide, the left edge of the element is
at around 16% of the window width, but the width of the column does not
exceed 36em. When the window is very narrow, the margin properties override
the width property, and the element becomes narrower than 36em. No clipping.

In IE4, all is well until you make the window very narrow. Here, the width
property overrides the margin properties, and clipping occurs. Note that you
can set a width only on the DIV element in IE4, not on anything more useful
like common paragraphs or BODY.

I like NS4's behavior better, but this is more a matter of convenience and
taste than conviction that it implements the spec more faithfully in this
regard. If the CSS1 Recommendation is ambiguous about this, perhaps it
should be made explicit in CSS2?
Received on Tuesday, 13 January 1998 13:01:48 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:46 UTC