我有一个父容器div和两个子容器,一个在父容器的左边,一个在水平的中间。我如何使用css做到这一点呢?假设html代码是这样的:
<div id="ParentContainer">
<div id="SubContainerToLeft"></div>
<div id="SubContainerInHorMiddle"></div>
</div>
发布于 2011-11-24 13:39:05
尝尝这个。
#ParentContainer {
height: 100px;
width: 500px;
}
#SubContainerToLeft {
float: left;
width: 50%;
}
#SubContainerInHorMiddel {
margin: auto;
width: 50%;
}
然后你想怎么玩边距和填充就怎么玩吧。你知道什么是边距和填充,对吧?
发布于 2011-11-24 13:41:47
https://stackoverflow.com/questions/8257936
复制相似问题