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

Re: CSS: %% length unit. Proposal.

From: Max Romantschuk <max@provico.fi>
Date: Fri, 07 May 2004 07:51:58 +0300
Message-ID: <409B15EE.70908@provico.fi>
To: www-style@w3.org

Andrew Fedoniouk wrote:
> I propose CSS length unit: %% (double percent unit) which could be
> applied to box dimensions and margins:
> 
> "The percentage is calculated with respect to the width of the generated
> box's containing block *minus widths of all fixed elements in the line*".
> 
> If applied these units allow to position proportionally elements horizontaly
> and verticaly without need to use tables.
> 
> Illustration
> :
> Lets say we have three blocks placed inline with widths 25%%, 100px and
> 75%%:
> |<--25%%-->|<--fixed:100px-->|<------75%%------>|
> 
> Actual first and third block widths will be calculated from
> ContainerContentWidth-100px weighted by their percentable values.

I like the idea, but would it be clearer to add syntactical support for 
simple expressions instead?

If I were authoring a style sheet I feel it would be a lot simpler to 
specify "width: 50% - 100px;". This way the style rule would be 
explicit, and the renderer would need to do less extra calculations in 
order to position the elements properly.

I'm not sure if this approach would limit Andrew's idea though, it's 
still 07:45 here and I'm not sure I'm awake to take all relevant aspects 
into account... Any gaping holes?

-- 
Max Romantschuk
http://max.nma.fi/
Received on Friday, 7 May 2004 00:53:43 GMT

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