We would like to know how to center inner div in another div.
<!--from w w w .j a v a 2 s .co m-->
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#header {
background: blue;
}
#main {
width: 200px;
height: 50px;
margin: 0 auto;
background: red;
}
</style>
</head>
<body>
<div id="header">
<div id="main"></div>
</div>
</body>
</html>
The code above is rendered as follows: