how to align heading in center in html code example

Example 1: html h1 left align

<h1 style="text-align:center">Titulo 1</h1>
<h2 style="text-align:left">Titulo 2</h2>
<h3 style="text-align:right">Titulo 3</h3>
<h4 style="text-align:justify">Titulo 4</h4>
<p>...</p>

Example 2: how to center html heading

Use the "style" tag inline along with "text-align" to do it. For example; 
<html>
  <head></head>
  <body>
    <h1 style="text-align: center;">TEST HEADING</h1>
  </body>
</html>

Example 3: align centre

.headerTwoDiv{
			margin:1% auto;
			margin-right: auto; margin-left: auto; width: 21%; 
			padding-top: 11px;
		}

Example 4: how to center text in html

With the aid of internal or external CSS you can center text with:

text-align: center;

Tags:

Css Example