Center Alignment is CSS

Published on Tuesday, December 14, 2010

1: Center Fixed-Width Layouts:

DIV#silverlightControlHost_centered
{
  width:800px;
  height:500px;
  margin-left: auto;
  margin-right: auto;
}

But some old browsers do NOT support above code

2: Center the body

body
{
    text-align: center;
}

div#container
{
    margin-left: auto;
    margin-right: auto;
    width: 50em;
    text-align: left;  /* IF you want to reset text align */
}