我想在我的div容器的頂部創建一個div(灰色背景),並且我無法使其與背景寬度大小匹配,因爲在左側存在一個間隙該塊。不能正確定位div
有人能解釋我爲什麼嗎?
body {
background-color: #a71930;
}
.container {
height: 1200px;
width: 1200px;
background-color: white;
margin-top: 50px;
}
div#about {
height: 400px;
width: 1200px;
background-color: #a5acaf;
margin-left: 0px;
}
<body>
<div class="container">
<div id="about"></div>
</div>
</body>