W3C home > Mailing lists > Public > www-style@w3.org > August 2000

Percentage values for Height and Width properties.

From: ValerieGSharp <ValerieGSharp@netscapeonline.co.uk>
Date: Mon, 28 Aug 2000 18:50:37 +0100
Message-ID: <39AAA66D.25946002@netscapeonline.co.uk>
To: "www-style@w3.org" <www-style@w3.org>
I imagine this would mostly be used to cause boxes to occupy a specified
percentage of their containing blocks.
However, when margins, borders and padding are added, the object will
extend beyond that percentage, and possibly even beyond its containing
block.

(For example, if I make a document 100% high and put a border on it, the
bottom of the border disappears off screen, and a scrollbar appears.)

I would be surprised if this particular effect were widely required -
rather, I suspect that most folk would prefer the *whole* object to be
occupying the specified percentage of the containing block (somewhat in
the way that 'auto' width - but not 'auto' height - is calculated?).

Maybe I've missed some other way to achieve this in CSS2, bit if not
then I suggest:

"10.2 Content width: the 'width' property 
....
<percentage>
  Specifies a width which is determined with respect to the width of
the generated box's containing block according to the following:

  'left' + 'margin-left' + 'border-left-width' + 'padding-left' +
'width' + 'padding-right' + 'border-right-width' + 'margin-right' +
'right' = percentage width of containing block "


And likewise for "10.5 Content height: the 'height' property..."
(including, of course, the bit about "If the height of the containing
block is not specified explicitly...etc").

-- 
Regards,
Val Sharp - Edinburgh
Received on Monday, 28 August 2000 13:51:15 GMT

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