Re: Ideas for CSS 3.0?

Mikko Rantalainen wrote:

>
> Gerard Torenvliet wrote:
>
>> I have been looking over the drafts for CSS 3.0, and they are missing 
>> a few
>> things that I had been hoping that I would see:
>>
>> -    the ability to achieve the same effect as the text-align style, but
>> for elements like div (i.e., to have the ability to set a div to a 
>> certain
>> size and then center that div in its parent)
>
>
> What's the problem with
> div { width: 55%; margin-left: auto; margin-right: auto; }
> ?
>
> The only thing I'm wondering is if text-align: justify combined with 
> inline-block elements can provide me with evenly spaced block-like 
> elements without using extra wrapper elements.

It's not about what's the problem with { width: 55%; margin-left: auto; 
margin-right: auto; } it is that { align: center; } would be much 
shorter and make a lot more sense to a lot more people. When I started 
using CSS with XHTML 1.1 I couldn't figure out why I had to use margins 
to align tables when in HTML I could do that with align="center".
Margins should not be used for alignment. We need to be able to type { 
align: center; } !
And it should not be for tables and divisions only but also for inline 
elements. That way you can center a div while the other things on top 
and under it will remain aligned to the left.
<Arthur/>

>
>> -    the ability to specify sizes in a combination of units (i.e. left =
>> 0.4em + 16px); this would allow me to more easily construct 
>> relative-sized
>> layouts
>
>
> Yes, that would have been great many times, but how complex formulas 
> should be supported? For example, one would need to be able to use 
> counters in the calculations to make it truly worth something. In 
> addition, if ::outside gets implemented you can more or less emulate 
> simple calculations with that -- at least how I've understood that.
>
>> -    the ability to specify widths and heights that span the remainder of
>> the space to the edge of the viewport; this would allow me to create
>> elements that, for instance, started at a left position of 20% and 
>> stretched
>> all the way to the right edge of the viewport.
>
>
> Like
> div { padding: 0; width: auto; margin-left: 20%; margin-right: 0; }
> ?
>
> If you want to discuss how some layout effect can be achieved with 
> currently available browsers, please subscribe to 
> <news:comp.infosystems.www.authoring.stylesheets>.
>

Received on Wednesday, 4 June 2003 15:18:33 UTC