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

Hi, guys,

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

Name of these units is *MultiLength*
[http://www.w3.org/TR/REC-html40/types.html#h-6.6]
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.
http://terrainformatica.com

==================================================
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

   FreeSpaceWidth = ContainerContentWidth - ActualContentWidth;

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

  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.

Done.

I am not sure is this clear or not?

Received on Monday, 10 May 2004 23:59:55 UTC