center tag (HTML 4.01)

centered text
Please be aware that this tag is deprecated within the HTML 4.01 specification! Look below for more details on an alternative.

Topics

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
onclicka pointer button was clicked 
ondblclicka pointer button was double clicked 
onkeydowna key was pressed down 
onkeypressa key was pressed and released 
onkeyupa key was released 
onmousedowna pointer button was pressed down 
onmousemovea pointer was moved within 
onmouseouta pointer was moved away 
onmouseovera pointer was moved onto 
onmouseupa pointer button was released 



© htmlpedia.net 2008 - 2012