Re: Center DIV

On Sunday, Jul 6, 2003, at 00:29 Europe/London, Ian Hickson wrote:

> Many people using margin: auto for centering. It is not an obscure
> feature, indeed it appears in several CSS FAQs and Wikis, and while I
> agree it is not intuitive, it is not complicated either.

I did not learn it until I joined this list, despite writing CSS sites 
on a daily basis for two years and using many sites to continually 
improve my technique.

> I'm not sure how that is relevant. The two features are distinct; one 
> is
> possible now, the other is not.

Simply that the margin:auto technique is no use unless the block to 
which it is applied does not have the automatically computed width. At 
the moment this means applying an explicit width, which is not the most 
useful solution when there are factors that affect the width that are 
out of the author's control. width:intrinsic solves this problem.

This all comes back to my point about CSS being a useful language for 
nailing things down by the pixel, but relatively tricky to use when all 
you want to do is describe the broad relationships between objects and 
have the browser do the work of putting them together in a way 
meaningful to the particular client. Such an approach to design is very 
useful for creating portable pages but is currently only really 
possible with tables.

As David Woolley said yesterday, the user is in the final control of 
the presentation (for better or for worse). At the moment CSS rules do 
not allow the designer to create layout rules that are willing to bend 
to accommodate both the user's will and the original design , where 
these do not directly conflict, on a higher level than pixels and 
colours. They create layout rules that snap instantly and are reduced 
to the lowest common denominator.

> Note that the WG _has_ considered adding simpler ways of doing some
> features that are technically currently possible, when the gain is 
> great.
> For example, it is technically possible to do vertical centering [1], 
> but
> there are proposals that would make it a lot simpler 
> ('position:center').

Absolutely, I'm happy to hear it and I think this is a positive step.

Ben


(q)	Ben Godfrey?
(a)	Web Developer and Designer
	See http://aftnn.org/ for details

Received on Sunday, 6 July 2003 11:17:24 UTC