Name

<CENTER> — NN all IE all HTML 3.2

Synopsis

<CENTER>...</CENTER>

End Tag: Required

The CENTER element was introduced by Netscape and became widely used before the W3C-sanctioned DIV element came into being. It is clear, even from the HTML 3.2 documentation, that the HTML working group was never fond of this element. Momentum, however, carried the day, and this element found its way into the HTML 3.2 specification. The element is deprecated in HTML 4.0 in favor of the DIV element with a style sheet rule of text-align:center. In lieu of style sheets (but still deprecated in HTML 4), you can use a DIV element with ALIGN="center".

Content of a CENTER element is aligned along an axis that runs down the middle of the next outermost containing element—usually the BODY.

Example

<CENTER>Don't do this.</CENTER>

Object Model Reference

IE

[window.]document.all.elementID

Attributes

CLASS

LANG

LANGUAGE

STYLE

TITLE

ID

    

Event Handler Attributes

Handler

NN

IE

HTML

onClick

n/a

4

n/a

onDblClick

n/a

4

n/a

onDragStart

n/a

4

n/a

onHelp

n/a

4

n/a

onKeyDown

n/a

4

n/a

onKeyPress

n/a

4

n/a

onKeyUp

n/a

4

n/a

onMouseDown

n/a

4

n/a

onMouseMove

n/a

4

n/a

onMouseOut

n/a

4

n/a

onMouseOver

n/a

4

n/a

onMouseUp

n/a

4

n/a

onSelectStart

n/a

4

n/a

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.