W3C home > Mailing lists > Public > www-style@w3.org > January 2011

Re: align property

From: Gérard Talbot <www-style@gtalbot.org>
Date: Wed, 26 Jan 2011 08:20:17 -0800
Message-ID: <0d2fb1868380ff672b069778667a468e.squirrel@cp3.shieldhost.com>
To: "Mark Kenny" <beingmrkenny@gmail.com>
Cc: "Bruno" <bruno5544@gmail.com>, "W3C style mailing list" <www-style@w3.org>

Le Mer 26 janvier 2011 7:34, Mark Kenny a écrit :
>> I understand there is always other way around something to achieve
>> what we need, but why not simply use logical solutions instead of
>> those "workarounds"?
> Actually, I think that's quite a fair point. I still don't quite like
> margin: 0 auto; though I use it all the time -- horizontal-align: center;
> would make much more sense.

'margin: 0 auto;'
does not just horizontally centers a block within its block container: the
code 'margin: 0 auto;' removes the margin-top and margin-bottom of such
block too.

> I also never got why vertical-align: middle; never worked like you'd
> expect
> it to work. Can anyone shed any light on that?

First, you can blame the CSS spec writers for not illustrating how the
vertical-align property is supposed to display/affect text (or images or
table cells) in short-and-easy-to-grasp examples with expected-results
diagrams in CSS1, then in CSS 2 and still today in CSS 2.1

(I still would need to add pictures in such webpage)

Second, you can blame web browser manufacturers for not implementing it
correctly during ~= 10 years:






The web development tutorial sites (w3schools, site point, etc.) too
should take a part of the blame for not correctly explain and illustrate
such property and others.

Often, what web authors want to vertically align can not be achieved by
simply using 'vertical-align: middle' anyway.
Beginner web authors often want very sophisticated websites while
expecting simple declarations to deal with massive code (html, css,
javascript) which they copied in all sorts of other websites.

regards, Gérard
CSS 2.1 Test suite RC5 (January 11th 2011)

Contributions to CSS 2.1 test suite

Web authors' contributions to CSS 2.1 test suite
Received on Wednesday, 26 January 2011 16:20:54 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 11 February 2015 12:34:47 UTC