Percentage values for Height and Width properties.

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 UTC