center a title in html code example

Example 1: center text in a html file

<tag class="" align='center'></tag>

Example 2: centering in html

<style>
  element
  {
    text-align: center;
  }
</style>
-------------------------------------------------------------------------------
style.css
element
{
	text-align: center;
}

Example 3: how to center a html header

h1{text-align: center;}

Example 4: align centre

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

Example 5: change the title in html using

document.title = "My New Page Title";

Example 6: align centre

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

Tags:

Css Example