Re: CSS: %% length unit. Proposal.

Hi, Gavin,

> Er, wouldn't that be:
>
> f1 {
> width:calc( (100%-100px)*.25);
> }
>
> and so on? This is what you expressed that 25%% would mean.
>

Indeed, simple case of %% calculation for this particular case can be
defined by this formula.

Formula approach contra's for layouts like this:
1) You should provide such formula for each block having %%:
|<--25%%-->|<--fixed:100px-->|<--50%%--->|<--25%%-->|
In each formula you will use the same 100px value. And if you will want to
change it in future then you need to update it in many places. This is not
so good I guess.
2) Width (100px) could be not known at design time. E.g. second block will
have width:intrinsic.
3) If some %% block will have min-width set to some value such formula will
become useless. Otherwise we need to intoduce conditional operations in
formulas.

Andrew Fedoniouk.
http://terrainformatica.com



>
> On May 8, 2004, at 12:11 PM, Andrew Fedoniouk wrote:
> > :)  Trust me with the calc situation even worse:
> >
> > For example layout like (four inline blocks: f1,f2,f3,f4):
> > |<--25%%-->|<--fixed:100px-->|<--50%%--->|<--25%%-->|
> > (Again %% means here percentage from free space = contentWidth-100px)
> >
> > Following your logic this should be represented by formula like this:
> > f1{
> >    width:calc(25%-33px);
> > }
>
> Er, wouldn't that be:
>
> f1 {
> width:calc( (100%-100px)*.25);
> }
>
> and so on? This is what you expressed that 25%% would mean.
>

Received on Tuesday, 25 May 2004 18:41:38 UTC