Let’s say you want your main wrapper div to be centered. It’s practiced widely so if you don’t know how I am going to show you the easiest way. for this example we are using embedded style rules not external Cascading Style Sheet (CSS). Your embedded style rules are placed within the head tag between ‘<style>’ & ‘</style>’ tags.
<title>Aligning DIV to the Center</title>
margin: 0 auto; /* it is same as saying top-0 bottom-0 left-auto right-auto | This alone aligns your div to the center */
<h2>This is the main wrapper div which is now aligned to the center</h2>
This example uses ID Selector to define the css rules. Hope this helps you. Smiles…