We would like to know how to center outer and inner div.
<!DOCTYPE html>
<html>
<head>
<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;
}
</style>
</head>
<body>
<div class="outer center">
<div class="inner center"></div>
</div>
</body>
</html>
The code above is rendered as follows: