I want to place a <div>
into another and want to center it.
My way is this:
<div id="redthing">
<div id="whitebox" >
</div>
</div>
The .css - code is the following:
#redthing {
margin-top: 2px;
background-color: #f00d28;
height: 250px;
}
#whitebox {
margin: 0 auto;
margin-top: 10px;
padding-top: 20px;
height: 10px;
width: 400px;
background-color: white;
border:5px solid #000;
}
Like you can see, padding and margin does not work to center it in the middle of the page(that means that there is the same place between the whitebox
and the top and the bottom of the redbox
.
Please help