Main Index |
Top Of Tree |
Tag Index |
Tag History
- What is it?
- Center is a tag that centers the text it contains in the browser
window. The interaction rules for this tag are somewhat unusual since it
is a tag first created by Netscape and has never had much in the way of
a official specification until recently. It behaves most closely like
other block formatting tags (in that a block is defined by having a
linebreak before and after the contained text.)
The tag was created to fill the need for authors to have some text
alignment controls, but most of the effects this tag produces have been
absorbed by other block formatting tags as the ALIGN attribute (which
extends control to right alignment as well.) This tag has found its way
into many other browsers, and is now even included in the HTML 3.2 draft.
Style Sheet Attributes
[More on Cascading Style Sheets]
- Class
- 2 | 3
| 3.2 | IE3B1
| M | N4B2
- Required? No
- Description:
This represents an assigned semantic classification grouping(s) for the
current tag.
- Values:
Given as a comma separated list of alphanumeric characters. Class names
may contain spaces (multiple consecutive spaces treated as a single
space.)
- ID
- 2 | 3
| 3.2 | IE3B1
| M | N4B2
- Required? No
- Description:
This assigns an alpha-numeric identifier that is unique
to this tag instance. Style sheets may use this attribute to reference
the current instance of this tag. Hyperlinks may also use this identifier
to serve as a destination.
- Values:
An alphanumeric string - initial character must be a letter followed
by alphabetic characters, digits, "-" or "."
characters. The allowable set of alpha-characters is restricted to the
A-Z and a-z set.
- Style
- 2 | 3
| 3.2 | IE3B1
| M | N4B3
- Required? No
- Description:
This attribute is a text string that provides rendering style
information for the current tag.
- Values:
Please see the description of
inline styles for more
information on how to use this attribute and its
possible values.
- Example
- <center>text</center>
- Parent Model
- %Block Format
Parent% |
%Multimedia
Parent% |
<Body> |
<Basefont>
- Content Model
- %Text% |
%Anchors% |
%Virtual Formatting% |
%Physical Formatting% |
%Line Break Content% |
%Multimedia Content% |
%Block Content% |
<address> |
<basefont> |
<Hx>
Tips & Tricks
- The CENTER tag has a much less strict parent/content model in
practice than other block formatting tags do. It is often used to
encompass other block formatting elements.
- Until the HTML 3.2 draft it was considered better HTML authoring to
use the P ALIGN or DIV ALIGN tags, but now that argument is not as
strong as it once was.
- Use of P ALIGN and DIV ALIGN DO allow a greater range of
alignment options for the author.
- CAVEAT: Use of any of the currently valid alignment properties to
center tables structures (CENTER, P ALIGN & DIV ALIGN) will have
an unfortunate effect on browsers that do not understand tables: It
will center all the table contents. This can render useless most
attempts to degrade tables gracefully and can create very odd looking
results. Remember to try viewing your pages on browsers with different
capabilities!
- DTD NOTE: Alignment tags/attributes do not
react very well with the MULTICOL tag.
Browser Peculiarities
- Tables capable browsers need either a CENTER tag or a DIV
ALIGN=CENTER tag to center an entire table.
Boring Copyright Stuff...