Re: Length unit relative to media width

GS wrote @2/20/2003 3:01 PM:
> On Thu, 20 Feb 2003 15:12 Alexander Savenkov wrote:
> 
>>>Screen (media) width in pixels is the basis for all visual
>>>information display.
>>
>>For poorly designed sites?
> 
> No, I did mean logically. Length is not a digital size.
> To use length you must  know how long a pixel is. 
> Any use of for instance mm units is undefined until you
> know how long  (in pixels) a "mm" is .

mm unit is defined to be equivalent to 1 millimeter. Your user agent 
might allow overriding any absolute size or there might be a bug that 
causes the user agent to mispresent the size, though

>>> Why not let the content be able to rescale automatically
>>> according to that
>> 
>> That's possible with current CSS implementations already.
> 
> No, it is not. Ask all those webdesigners out there, strugglig with
> this problem every day. No such possibility today without useing scripting.

It depends... if you want to scale everything so that it still fills the 
viewport regardless of the viewport size, then you're right. If, 
however, you mean something that user can scale as she likes, that can 
be done today with the "em" and percentage units.

>>> Why make things more complicated than necessary?
>>
>>Don't know. The 'screen-width' propery wasn't proposed by me.
> 
> Not by me either, but I think it is av great idea, and not complicated.

I can see many problems with that but I'll support anything that helps 
content authors to understand that "px" isn't always equivalent to one 
pixel on the screen.

The problems I can see with the proposed "screen-width":

Authors keep designing the fixed size layouts they're doing today. The 
only exception is that every browser can scale the result like Opera 
does today. This results to those really tiny fonts on really lenghty 
lines and there's nothing I (as a reader) can do for it. So intead of 
viewing fixed 640 pixel width layout I can see the same layout but it's 
automatically scaled to fill my viewport. If my window is small, the 
text will be scaled so small that I cannot read it. If my window is 
huge, the text will be scaled huge and so on. There's no end for the 
problems.

However, the reason I still support this proposal is that it allows one 
to design overall layout according to viewport width more easily than 
using percentages (because this new method allows sizing stuff according 
to viewport width instead of parent element width. The pros are quite 
similar to proposed "rem" (root em) unit.

A new idea...

I think we need a new unit that is relative to viewport width (like 
"w%") instead of this proposal. Perhaps add another unit for the 
viewport height ("%h") so that I can easily create an element that is 
exactly as high as the viewport.

So writing markup like
<div class="box">foo</box>
with the style
div.box { width: 50w%; height: 50h%; background: silver; }
would result to a silver box that fills exactly one fourth of the 
viewport. The box would scale if I resize the viewport.

Combine that with a property called "aspect-ratio" and you can define 
stuff according to height or width of the viewport. (e.g. I could create 
a square of which side length would be exactly 25% of the viewport width.)

[Sorry for the "English". I'm a bit hurry right now.]

-- 
Mikko

Received on Thursday, 20 February 2003 13:13:06 UTC