Learning HTML 3.2 by Examples, section 5 Descriptions of HTML 3.2 tags:

CENTER - centering (Not in HTML 2.0!)


To specify that part of a document to be centered in the rendering.

Typical rendering


Basic syntax

a section of the document

Possible attributes


Allowed context

Block container.


Headings, text elements, block elements, and ADDRESS elements.


Example CENTER.html:

This is a normal paragraph which will be rendered according to
default alignments, which usually means left alignment.
This is text which will be centered.
This is a longer text paragraph which will be centered.
It is so long that line breaks will most probably occur.
Notice that the division into lines is usually not the same
as in the HTML file.


In HTML 4.0, the CENTER element is deprecated in favor of style sheets.

Using ALIGN attribute in P and heading elements is preferable to using DIV.

CENTER is defined as equivalent to DIV with ALIGN=CENTER. CENTER was introduced by Netscape before they added support for the DIV element. It is retained in HTML 3.2 on account of its widespread deployment.

Since CENTER is a block element, it terminates an open P element ( i.e. causes the browser to assume an implied </P> tag when necessary). Other than this, browsers are not expected to render paragraph breaks before and after CENTER elements. If paragraph breaks are desired, you can use the P element with an ALIGN attribute instead.

Date of last update: 2010-12-16.
This page belongs to the free information site IT and communication, section Web authoring and surfing, by Jukka "Yucca" Korpela.