• Skip to primary navigation
  • Skip to main content

Tech Honey

The #1 Website for Oracle PL/SQL, OA Framework and HTML

  • Home
  • HTML
    • Tags in HTML
    • HTML Attributes
  • OA Framework
    • Item in OAF
    • Regions in OAF
    • General OAF Topics
  • Oracle
    • statement
    • function
    • clause
    • plsql
    • sql

Text align center html

HTML Center Tag

August 12, 2013 by techhoneyadmin

HTML Center Text TagIn HTML center text can be done using the HTML Center Tag. In other words we can say that whenever we want to align center any text in HTML we can use the HTML Center tag.

The HTML Center Tag is not supported in HTML 5 and is deprecated in HTML 4.0.1 hence we have to use CSS to HTML Center Text in any resource or webpage to align text at the center.


Syntax for HTML Center Text Tag

Some Text in beginning

<center>
Some text in center
</center>

Some text in the end


Example for HTML Center Text Tag

HTML Center Text Tag Code Output
This is a text in the beginning.
<center>This is the text that will be centered.</center>
This is the text at the end.
This is a text in the beginning.
This is the text that will be centered.

This is the text at the end.

Here in the HTML Center Text example we can see that the text written within the HTML Center tag is aligned to the center of the space available for the output to be displayed whereas the rest of the text is aligned to the left of the available space.


HTML Center Text Tag Supporting Attributes

HTML Center Text Tag Attribute Name Value Description
class classname Indicates a classname for the tag
dir rtl, ltr Indicates the text direction: right to left (rtl) and left to right (ltr).
id id Defines a unique id for the tag
lang language_code Indicates the language code for the language contained within the tag
Style style_definition Indicates an inline style for the tag
Title text Defines additional information about the tag

See all HTML Global Attributes.


HTML Center Text Tag Supported Event Attributes

HTML Center Text Tag Event Attributes Value Description
onclick Script/code Script/code to be executed on mouse click
ondbclick Script/code Script/code to be executed on mouse double click
onmousedown Script/code Script/code to be executed on mouse button is pressed
onmousemove Script/code Script/code to be executed on mouse pointer moves
onmouseout Script/code Script/code to be executed on mouse pointer moves out of the target element
onmouseover Script/code Script/code to be executed on mouse pointer moves over the target element
onmouseup Script/code Script/code to be executed on mouse button is released
onkeydown Script/code Script/code to be executed on key press
onkeypress Script/code Script/code to be executed on key pressed and then released
onkeyup Script/code Script/code to be executed on key is released

See all HTML Event Attributes


HTML Center Text Tag Supporting Browsers

S. No. Browser Supported(Yes/No)
1 Internet Explorer Yes
2 Firefox Yes
3 Google Chrome Yes
4 Opera Yes
5 Safari Yes

Filed Under: Tags Tagged With: Align center html, Center align html, Center Html, Center in html, Center text html, Center text in html, How to center align text in html, HTML Align center, HTML Center, Html center align, Html center code, Html center tag, HTML Center Text, Html code for center, Html code to center text, Html text align center, Html text center, HTMLCenterTag, Text align center html, Using html center tag, What is the use of html center tag

Copyright © 2025 · Parallax Pro on Genesis Framework · WordPress · Log in