W3C home > Mailing lists > Public > www-style@w3.org > October 1997

Re: With CSS how does one ALIGN block-level elements?

From: David Perrell <davidp@earthlink.net>
Date: Mon, 20 Oct 1997 12:30:47 -0700
To: <neil@bigpic.com>
Cc: <www-style@w3.org>
Message-ID: <01bcdd8e$aabc6860$b111d9cf@davidp>

Neil St.Laurent wrote:
--- "
The former <DIV ALIGN=center> would make sure that all block-level
elements are centered, and that the text-alignment is centered as
well.
" ---

Not so in Wintel versions of MSIE4 and NSN4. Both will center a IMG (which
by default is inline, not block), but not a table.

--- "
A TABLE is the only thing that would be centered that is block level
and doesn't just have text in it (as opposed to P or BLOCKQUOTE).
Additionally specifying <DIV ALIGN=CENTER> did not affect the
alignment of the text in the table itself, should not <DIV
STYLE="text-align: center"> center align all of the table text?
" ---

There was discussion about this a short time ago. In order to display a
table in accordance with the HTML spec and/or 'legacy' browser behavior,
there must be text-align and font-weight declarations for TH and TD in the
hypothetical 'default' stylesheet. Those declarations will override
inheritance on table cells, and unless otherwise explicitly declared in the
author's stylesheet, TH will be bold centered and TD will be normal flush
left.

Note that if text-align and font-weight have not been declared in the author
stylesheet for P, TABLE, TR, TH, or TD, and a P is nested inside a TH or TD,
the P element content will be bold centered or normal flush left,
respectively. Inheritance will be from the closest ancestor with an explicit
declaration.

David Perrell
Received on Monday, 20 October 1997 15:32:36 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:53:51 GMT