Re: Proposal: dimension expressions

On Fri, 2 Mar 2001, David Eisenberg wrote:

>Thus allowing you to solve the liquid layout problem by specifying
>
>  .index-class {width: 25%-22px; margin: 5px; padding: 6px; }
>  .content-class {width: 75%-14px; margin: 3px; padding: 4px; }

This is a very familiar problem to me, and what I've thought is that the
containing box's width and height should be available as units. So instead
of saying width:50%, you could say e.g. width:0.5w; padding:0.25w. The
one for height could be 1h... This would not necessitate much new syntax,
just two new relative units with wider applicability than the one you get
with percentage values. It would also make absolute positioning people
happy, since you could now say height:1w for a rectangular box. Easy, no
arithmetic and looks like existing CSS. Undetermined units could be treated
as 'auto', like in the rest of the spec. And it would solve most of my own
troubles regarding table width calculation, especially when the box-sizing
(or whatever...) attribute you mentioned is implemented as well.

Sampo Syreeni <decoy@iki.fi>, aka decoy, student/math/Helsinki university

Received on Sunday, 4 March 2001 07:48:40 UTC