The CENTER Element

The <center> element causes the enclosed contents to be center aligned within the margins of the current element. These margins are either the default page margins (for the body contents) or the margins of specific elements (like div, span or tables).

Syntax:
<center property=”value” property=”value” …. >
content to be centered
</center>

Valid Properties:
The <center> element has the following properties -
1. class
2. dir
3. id
4. lang
5. style
6. title

Refer to  Common Properties page for details of these properties.

Example:
<center> This is a sample piece of text that is placed at the center of the page.</center>

Notes:
1. <center> element was defined by W3C as a shorthand notation for <div align=”center”>
2. Strict versions of the HTML and XHTML do not include the <center> element. The <center> element is deprecated and CSS is used to aligne the contents anywhere on the page.
3. HTML 3.2 does not support any properties for the <center> element.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.