W3C home > Mailing lists > Public > www-style@w3.org > November 2007

CSS 2.1 - 10.3.3 - Block-level, non-replaced elements in normal flow

From: Rossen Atanassov <ratan@windows.microsoft.com>
Date: Tue, 6 Nov 2007 08:41:35 -0800
Message-ID: <802A881C87166D4597F9EEFC3F04F4F8062403BE@WIN-MSG-20.wingroup.windeploy.ntdev.microsoft.com>
To: <www-style@w3.org>
Hello,

 

I have few questions about the rules in CSS 2.1 - 10.3.3 - Block-level,
non-replaced elements in normal flow. According to this section the
following equation must be satisfied: 

 

margin-left + border-left + padding-left + width + padding-right +
border-right + margin-right = containing block's width

 

Then, a number of rules are applied in order to satisfy the above.
Here's an example which illustrates my questions:

 

<div style="width:0px;">

    <div style="margin:10px;">text</div>  <- - This is the block-level
element I want to apply these rules to.

</div>

 

1.        First statement does not apply since the width is 'auto' (from
its initial value)

2.       Second statement does not apply for the very same reason

3.       Third rule does apply since we have exactly one value of
'auto', namely the width. So the spec suggests that value follows from
the equality above, which would make the used width to be negative value
(-20px).

 

However, section CSS2.1 - 10.2 Content width: the 'width' property,
states that "Negative values for 'width' are illegal." So here goes my
questions J

 

1.        Is the width property handled as a special case to all these
scenarios (undocumented)?

a.       If so, then I assume margin-right (assuming ltr) must take the
negative value?

2.       What about other properties such as padding-left|right and
border-left|right, are these allowed to become negative following these
rules?

 

Thanks!

 

Rossen Atanassov

 
Received on Tuesday, 6 November 2007 16:43:30 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:56 GMT