View video tutorial

HTML <center> Tag

HTML

Not Supported in HTML5. It is recommended not to use this tag.

HTML <center> Tag


➔ The <center> tag is used to set text alignment in the center of the element.

➔ Use CSS to apply the same result instead.

Learning with HTML Editor "Try it Now"

You can edit the HTML code and view the result using online editor.

Example

<style>
    h1.cntr,p.cntr,div.cntr {
        text-align: center;
    }
</style>
<h1 class="cntr">This is a heading.</h1>
<p class="cntr">This is a paragraph.</p>
<div class="cntr">This is a div.</div>
Try it Now »

Click on the "Try it Now" button to see how it works.