a<div>
を別の a に配置して、中央に配置したい。私のやり方はこれです:
<div id="redthing">
<div id="whitebox" >
</div>
</div>
.css - コードは次のとおりです。
#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;
}
ご覧のとおり、ページの中央にパディングとマージンが機能しません(つまり、whitebox
と の上下の間に同じ場所があることを意味しredbox
ます。助けてください