title: How to centre a div inside a div?
body: <p>How can a centre a div inside another div (both vertically and horizontaly) using CSS?
  My html is</p>
  <p><code>&lt;div class='outer'&gt;&lt;div class='inner'&gt;&lt;/div&gt;&lt;/div&gt;</code></p>
  <p>And CSS -</p>
  <pre><code>.outer{
  position: realative;
  top:20%;
  left20%;
  width:500px;
  height:500px;
  background:red;
  }
  .inner{
  position:relative;
  width:100px;
  height:100px;
  background:#ff2;
  /*code to align in centre*/
  }
  </code></pre>