我想#container
将集中在#main_content
. 然而,事实并非如此。为什么这不起作用,我该如何解决?
#main_content {
top: 160px;
left: 160px;
width: 800px;
min-height: 500px;
height: auto;
background-color: #2185C5;
position: relative;
}
#container {
width: auto;
height: auto;
margin: 0 auto;
padding: 10px;
position: relative;
}
<div id="main_content">
<div id="container">
</div>
</div>