HTML Element Style How to - Center outer and inner div


We would like to know how to center outer and inner div.


<!DOCTYPE html>
<style type='text/css'>
.outer {<!--  www .  ja  v a 2 s.  c o  m-->
  position: absolute;
  width: 400px;
  height: 400px;
  background: #999;

.inner {
  position: absolute;
  width: 200px;
  height: 400px;
  background: #666;

.center {
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
  <div class="outer center">
    <div class="inner center"></div>

The code above is rendered as follows: