position center in html code example

Example 1: center image css

.centerImg {
  display: block;
  margin: 0 auto;
}

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;
		}

Tags:

Misc Example