<center>
HTML <center> Tags - HTML5 Not supported
##Instance
Run instance»Click the "Run instance" button to view the online instance
<!DOCTYPE html> <html> <body> <p>This is some text.</p> <center>This text will be center-aligned.</center> <p>This is some text.</p> </body> </html>
Run instance»Click the "Run instance" button to view the online instance
Browser support
##All major browsers support the <center> tag.
Tag definition and usage instructionsHTML5 does not support the <center> tag. Please use CSS instead.
In HTML 4.01, the <center> element is deprecated.
<center> Centers the text it contains horizontally.
Tips and NotesTips:
Please use CSS styles to center text! You can learn more details about centered text in the CSS tutorial.
HTML5 does not support the <center> tag, and HTML 4.01 has deprecated the <center> tag.
Standard attributesIn HTML 4.01, the <center> tag supports the following standard attributes:
Value | Description | |
---|---|---|
classname | Specifies the class name of the element | |
rtl | ltrSpecifies the text direction of the content in the element | |
id | Specifies the uniqueness of the element id | |
language_code | Specifies the language code of the content in the element | |
style_definition | Specifies the inline style of the element | |
text | Specifies additional information for elements |
Value | Description | |
---|---|---|
script | When the mouse is clicked Execute script||
script | Execute script when the mouse is double-clicked||
script | Execute script when mouse button is pressed||
script | Execute script when mouse pointer moves||
script | Execute the script when the mouse pointer moves out of an element||
script | When the mouse pointer hovers over Execute the script when on an element||
script | Execute the script when the mouse button is released||
script | Execute script when the keyboard is pressed||
#script | Execute script when the keyboard is pressed and then released | |
script | Execute script when the keyboard is released |