W3C home > Mailing lists > Public > www-style@w3.org > May 2004

CSS: %% length unit and HTML's MultiLength unit.

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Mon, 10 May 2004 20:58:36 -0700
Message-ID: <001b01c4370c$3dd94180$0301a8c0@ATHLON>
To: "Andrew Fedoniouk" <news@terrainformatica.com>, "Boris Zbarsky" <bzbarsky@MIT.EDU>
Cc: <www-style@w3.org>

Hi, guys,

I've found that HTML 4.0 specification already has concept of %% units. :)

Name of these units is *MultiLength*
However this concept applicable only for tables (COL and COLGROUP in
particular) and framesets.

Seems like MiltiLength units are gone from table-* styles for some reason.

Andrew Fedoniok.

Here is my second attempt to formalize algorithm of %% computing:

%% units calculation algorithm for inline elements:

First step :
   calculate actual space needed to place/position all elements
   in the line box using standard CSS rules.
   Don't count any attribute having value in %% units at this step:

   ActualContentWidth = width of all elements in the line box.

Second step:
   Substract this ActualContentWidth from ContainerContentWidth to get

   FreeSpaceWidth = ContainerContentWidth - ActualContentWidth;

Third step:
  Calculate actual lengths of all attributes measured in %% units using

  Length = (AttributeValue * FreeSpaceWidth) / 100

Fourth step:
   Replace needed elements in the line according new dimensions.
   This will not force relayout of elements which do not have atrributes
given in %% units.


I am not sure is this clear or not?
Received on Monday, 10 May 2004 23:59:55 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:13 UTC