样式表问题,div容器中内嵌2个div,如何让容器div在页面中居中。
<div id="layout">
<div id="left"></div>
<div id="right"></div>
</div>
left和right div必须在layout中居中显示,同时layout必须在页面中居中显示。
样式该如何写?
以下写法不对。(浏览器为IE7)
<style type="text/css">
#layout
{
margin:0px auto;
width:408px;
/×text-align:center;*/
}
#left
{
width:200px;
height:300px;
float:left;
}
#right
{
width:200px;
height:300px;
float:left;
}
</style>