We would like to know how to center div inside a div.
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#box {<!-- w w w.j av a2 s. c om-->
width: 300px;
height: auto;
border: 1px solid;
}
div.content {
width: auto;
height: 300px;
background: #333;
margin: 10px;
}
p {
background: #666;
text-align: center;
height: auto;
}
</style>
</head>
<body>
<div id="box">
<p>BELOW IS SOME CONTENT</p>
<div class="content"></div>
</div>
</body>
</html>
The code above is rendered as follows: