CENTER element [Was: Netscape & New HTML]

Joe English (jenglish@crl.com)
Thu, 20 Oct 1994 17:51:44 -0700


In comp.infosystems.www.misc,
in article <marca-2010940637410001@gator1.mcom.com>,
marca@mcom.com (Marc Andreessen) wrote:

>twpierce@midway.uchicago.edu wrote:
>> I'm curious about something. Why, in order to implement
>> line centering, did you choose to create a new <CENTER> tag,
>> rather than merely implementing a <P ALIGN=CENTER> tag as
>> implemented in the HTML+ draft? Granted, it isn't standard,
>> but it's certainly closer to a standard than what you've
>> done. Wouldn't that be more consistent with such practice
>> as already exists?
>
>No, there is no such practice that currently exists

Except in emacs-w3, AIR Mosaic, it's planned for Cello,
and for the last six months anytime anyone asks "How do
I center..." on c.i.www.* the answer has been "use
<P align=center> and wait."

> (the HTML+
>draft itself is even long expired),

True, but there is so much perceived consensus on
this particular issue it's a safe bet that alignment
attributes are going to make it into the standard
at SOME point.

>and <P ALIGN=CENTER> makes little sense
>given that (a) standard practice is that <P> is end of paragraph, not
>a container,

That may be the *existing* practice; the *standard* practice --
namely, what's recommended by the HTML 2.0 draft standard --
is that <P> is a container.

(Container, container, container!)

> and (b) document authors want to center sections of
>content, not just single paragraphs.

Good point.

> I look forward to these issues
>being addressed in an appropriate standards forum.

====

PROPOSAL:

That a CENTER element (described below) be added to
the next revision of the HTML standard.

DESCRIPTION:

CENTER is used to center lines of text.

RATIONALE:

Document authors often want to center large sections
of a document, not just individual units. The proposed
alignment attributes for paragraphs, headings and other
elements are inadequate and cumbersome for this purpose,
since they force authors to enter the same attribute
specification on many different tags.

SEMANTICS:

The CENTER element has no associated semantics. Instead,
it is strictly a presentational hint (much like the B, I, TT
and U character formatting elements).

SPECIFICATION:

The CENTER element is a block-level element, similar to
BLOCKQUOTE. It may appear inside the BODY element, list items (LI,
DD), FORMs, and anywhere other block-level elements are allowed.

Headings, paragraphs, lists, and other block-level elements may
appear inside CENTER elements.

Both the start-tag <CENTER> and the end-tag </CENTER>
must be present.

SUGGESTED RENDERING:

CENTER implies a line break before and after the element.

Inside a CENTER element, each line of paragraphs, lists, and
headings should be displayed centered instead of flush-left.
That is, the center of each text line should be vertically
aligned with the center of the display area.

CENTER should not affect the line-breaking algorithm: it only
changes the final placement of text lines.

Preformatted text blocks (PRE) and other block display elements
(such as tables, if implemented) within CENTER should be centered
as a unit, not line-by-line.

Browsers that use flush-right or flush-both justification as the
default rendering for any elements should disable this for elements
inside a CENTER.

In the case of conflicting alignment specifications, the innermost
specification overrides the outermost. For example, if the
proposed <P ALIGN=RIGHT> appears inside a CENTER, the paragraph
contents should be displayed flush-right, but everything before and
after should be centered.

CHANGES TO DTD:

This element may be added to the DTD with minimal changes:

1) Add CENTER to the %block; parameter entity declaration:

<!ENTITY % block "P | %list | DL
| %preformatted
| BLOCKQUOTE | CENTER %block.forms">

2) Add the following element declaration:

<!ELEMENT CENTER - - %body.content;>

No other changes are necessary.

SAMPLE IMPLEMENTATION:

This element is implemented by the Netscape browser,
now available at FTP sites everywhere. (Plug: Netscape's
got a few other neat features that you might also
want to try out :-)

IMPACT ON EXISTING IMPLEMENTATIONS:

None. Existing browsers can safely ignore the CENTER
start- and end- tags; the resulting display will
still be a correct rendering of the document content.

====

There. What was so fucking hard about that?

====

Now if someone made that proposal, someone else might have come up with
a counter-proposal:

Based on the rationale for CENTER, it seems that what is *really*
desired is a mechanism for treating large sections of a document as
a unit, and not centering _per se_.

How about adding a general-purpose DIVISION element instead?

DIVISION would be allowed in the same places as the proposed
CENTER element, and defined like:

<!ELEMENT DIVISION - - %body.content;>

<!ATTLIST DIVISION
ID ID #implied -- Unique identifier --
ALIGN (left|center|right) #implied
-- default value for alignment is "no change" --
-- Others attributes? --
>

The ID attribute allows DIVISIONs to work as link destinations.

This element would allow large sections of text to be centered (as
desired), and would be more generally useful than a special-purpose
CENTER element.

====

See how responsive MCOM is to the needs of the users?
They wanted a <CENTER> tag and MCOM gave it to them.
If it were up to all the SGML purists on www-talk
nobody would have any control over how their documents
look at all.

====

Final note: The CENTER proposal is a serious one.
So is the counter-proposal for DIVISION.

--Joe English

jenglish@crl.com