Re: New layout language.

Laurens Holst wrote:

> How?
>
> It is utterly simple. You have a block, which is initially the size of 
> the content (if any, or 0x0). If you want it to have a 10 pixel empty 
> space around it, you position it 10px from the top, left, right and 
> bottom, which will make it ‘stretch’ horizontally and vertically as 
> necessary. Linking the dimensions to the window borders ensures that 
> the box resizes with the browser window.
>
> Similarly, if you want a box from (0,0) to (50,200) you just specify 
> left, top and width, height. If you want a box next to that from 
> (50,0) to (total width, unspecified) then you specify left, top and 
> right.
>
> I don’t see how that is so terribly unintuitive. The only reason why 
> it might not be is because it is currently impossible in IE to use 
> absolute positioning like that, and CSS users have therefore never 
> used it as such and are also not taught to do that. Instead they think 
> in terms of percentage widths, and that is pretty much the point where 
> they usually start to complain about the content box model.
>
> This should also work perfectly fine for GUI tools to layout a design.
>
> By the way, in your example that you gave without right: and bottom:, 
> how can you specify that something ends x pixels before the end of the 
> window? In fact, how can you specify the place where a box ends in 
> anything else but percentages? You can’t, so I think that makes your 
> proposal officially less powerful than CSS currently is :).
>
>
> ~Grauw
>
Better yet, you can turn an outer object into a positioning context 
simply by using position: relative with no offsets.  Then top: 0; 
bottom: 0 will cause the positioned object to resize to the height of 
the object it's positioning to (<div role="body">, anyone?)

-- 
http://www.mozilla.org/products/firefox/ - Get Firefox!
http://www.mozilla.org/products/thunderbird/ - Reclaim Your Inbox!

Received on Wednesday, 6 July 2005 19:28:57 UTC