Re: CSS: %% length unit. Proposal.

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 UTC