HTML Element Style How to - Center div


We would like to know how to center div.


<!DOCTYPE html>
<style type='text/css'>
div {<!--   w  w  w. j  a va 2  s . c  o m-->
  border-radius: 5px;

#header {
  /*position: fixed;*/
  background-color: #3399ff;
  color: white;
  width: 60%;
  margin: auto;

#header p {
  display: inline;
  <div class="headerContainer">
    <div id="header">
      <p>This is a test.</p>

The code above is rendered as follows: