html tutorial - How to align a DIV horizontally center using CSS - html5 - html code - html form
Answer: Set the style rule "margin:0 auto;" for DIV
If you would like to align the <div> element horizontally center with respect to the parent element you can use the CSS margin property.
Example
As you can see we have applied the auto value to the left and right margin property of the <div> element.
Note:This use to works when the width of parent element is containing <div> element that you want to align.