center tag (HTML 4.01)
centered textPlease be aware that this tag is deprecated within the HTML 4.01 specification! Look below for more details on an alternative.
The center tag will take a piece of text and align it to the middle of the page, like this:
Centered text
However, the center tag has been deprecated for quite a while now, and really should be avoided. W3 started out by recommending the usage of the div tag with the align property set to center, but since the align property of the div tag has been deprecated since that, it's no longer the optimal solution. Instead, you can use a div tag and the CSS property text-align, which will have the same effect.
Attributes
| Attribute | Deprecated | Required | Description |
|---|---|---|---|
| class | space-separated list of classes | ||
| dir | direction for weak/neutral text | ||
| id | document-wide unique id | ||
| lang | language code | ||
| style | associated style info | ||
| title | advisory title |
Events
| Event | Description |
|---|---|
| onclick | a pointer button was clicked |
| ondblclick | a pointer button was double clicked |
| onkeydown | a key was pressed down |
| onkeypress | a key was pressed and released |
| onkeyup | a key was released |
| onmousedown | a pointer button was pressed down |
| onmousemove | a pointer was moved within |
| onmouseout | a pointer was moved away |
| onmouseover | a pointer was moved onto |
| onmouseup | a pointer button was released |
© htmlpedia.net 2008 - 2012