this may looks like the usual how to center a float question but the reason i need to center a float div is because other div container is also having a float property. I have set an height auto to determine the height depend on the object inside the wrapper div, within the wrapper div there is 2 float div to make it side by side. However if i did not specify a float on the wrapper the wrapper div would only show 1 staight line(not wrapping anything)
div.wrapper{
width: 1000px;
height: auto;
margin-top: 30px;
float: left;
border:1px solid gray;
}
div.leftcontainer{
width: 200px;
height: auto;
margin-top: 10px;
margin-left: 10px;
border:1px solid gray;
float: left;
}
div.right container{
width: 750px;
height: auto;
margin-top: 10px;
margin-left: 15px;
margin-right: 15px;
border:1px solid gray;
float: right;
}
这是我的html法典。
<div class ="wrapper">
<div class ="leftcontainer">
some options
</div>
<div class = "rightcontainer">
some options
</div>
<div class = "rightcontainer">
some options
</div>
</div>
因此,如何把我的包裹放在一起 不去掉实现这一点的浮动或其他方式? 增 编