HTML <center> tag

Use of <center> tag

The <center> tag is not supported in HTML5. It is used to make the texts center-alignment.
Type: Block Element

Example of <center> tag

<center> Center alignment texts </center>

Supported Browsers

Tag Chrome browser Internet explorer browser Firefox browser Safari browser Opera browser
<center> Yes Yes Yes Yes Yes

Full Code Example

<!DOCTYPE html>
<html>
<head>
</head>
<body>
<p>
Left alignment texts
</p>
<center> Center alignment texts </center>
</body>
</html>

Output

Left alignment texts

Center alignment texts

More Reference

<center> tag is not supported in HTML5. Use CSS properties text-align to make the alignment of texts.

text-align: left | right | center | justify | initial | inherit;

Attributes values

Value Notes
left It defines left-alignment texts.
right It defines right-alignment texts.
center It defines center-alignment texts.
justify It preserves both right and left alignment i.e. all the lines are stretched at the max value and equal in length.
initial It sets the alignment into default value.
inherit It inherits from the parent value.