Re: [css3] "keep aspect ratio" feature

The idea is interesting, but by redefining what "auto" width or height  
mean in the presense of an explicit ratio, don't you proclude the  
ability to have a flexible width with a height that is proportional to  
that width? Or does the new meaning of "auto" only apply to height?

Sent from my iPhone

On Nov 24, 2008, at 12:26 PM, Christoph Päper <christoph.paeper@crissov.d 
e> wrote:

>
> Andrew Fedoniouk:
>> Time to time I am getting feature request to provide "keep aspect  
>> ratio" functionality in CSS.
>>
>> To declare function 'width(NN%)' that can be used as a value of  
>> height, min-height, max-height CSS attributes.
>>
>> #my-golden-ratio {
>>  width: 30%;
>>  height: width(62%);
>> }
>
> Why would you make either width or height depend on the other when  
> you really want to provide their ratio (or area, i.e. either the  
> result of their division or their multiplication)?
>
>  foo {
>    ratio: calc(4/3); /* ignored if contradicting explicit width/ 
> height,
>                         because it is not needed then */
>    width: 4cm;
>    height: auto; /* -> 3cm */
>  }
>
>  foo {
>    area: 12cm; /* _square_ centimetres actually, but we only need  
> the scale,
>                   the power is encoded in the property */
>    width: 4cm;
>    height: auto; /* -> 3cm */
>  }
>

Received on Monday, 24 November 2008 20:58:07 UTC