请如何使用css3水平对齐div标签的两个内容。我包围的主体的总宽度为950像素,我将第一个div标签的宽度指定为470像素。我的假设是,第二个div标签将占据剩余的空间也就是480像素,但它没有,而它被定位使用css3水平对齐div标签
这是HTML代码
To know what's cooking you can check our events for more
For more information Contact Us
[email protected]
08138549501
Tell us what you think or feel about this site
Send
这是CSS,它包括容器,左右div标签css。
container{
width:950px;
margin:0;
margin-left:auto;
margin-right:auto;
border-style:solid;
background-color:orange;
}
.left {
width:450px;
margin-left:10px;
}
.right{
width:390px;
margin-left:10px;
}
2013-12-17
Olu
+3
我们可以在这里看到你的CSS吗?我猜你永远不会设置.left和.right浮动或内联,所以它们被设置为块。 –
+1
你可能会发现这有帮助 - http://stackoverflow.com/questions/2935404/cross-browser-div-center-alignment-using-css –