We would like to know how to center a div inside of another div.
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#container {<!-- w w w . j ava2 s.c o m-->
width: 775px;
margin: 0 auto;
text-align: center;
background: red;
}
.innerdiv {
display: inline-block;
text-align: left;
background: green;
}
</style>
</head>
<body>
<div id="container">
<div class="innerdiv">Lorem Ipsum is simply dummy text of the
printing and typesetting industry. Lorem Ipsum.
</div>
</div>
</body>
</html>
The code above is rendered as follows: