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

CSS: %% length unit. Proposal. Some clarifications.

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Sat, 8 May 2004 15:27:28 -0700
Message-ID: <001701c4354b$a58d3290$0301a8c0@ATHLON>
To: "Ian Hickson" <ian@hixie.ch>
Cc: <www-style@w3.org>

Hi, Ian,

>
> The biggest problem I have with your idea is I don't know what you mean by
> "free space". *There is no such term in CSS2.1*.
>

Not exactly.

Indeed, there are now "free space" in CSS expressed clearly.

But this principle already implemented in tables where you can mix columns
with fixed width and coulumns with percents.
Percent columns widths calculated based on free space concept - space left
from all fixed columns.

One more illustration what this "free space" is:
The markup:
<p style="text-align:justify">one two three</p>

could be modelled by using %% units as:

<p >one<span style="margin-left:50%%;
margin-right:50%%;">two</span>three</p>
-or-
<p >one<span style="width:50%%"> </span>two<span style="width:50%%">
</span>three</p>

%% length units (or whatever they'll be named):

%% units are applicable to margin and dimension attributes (width, height).
%% units in margin-top, margin-bottom and height derive their values from
container height minus heights of all siblings having heights in units other
than %%,
margin-left, margin-right and width derive their values from container
width, etc. ....

%% units:

1) are easy to implement. All mechanisms already implemented in browsers.
2) allow to reduce need of use of fixed and float positioning.
3) allow to reduce need of <table> for layout purposes.
4) easy understandable by humans.
5) could be strongly specified in specs - will be interpreted in the same
way in different UAs.
6) complexity of layout algorithm is O(n) (worst case).

Andrew Fedoniouk.
http://terrainformatica.com
Received on Saturday, 8 May 2004 18:26:41 GMT

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