我有以下问题与三栏标题相关。CSS三栏标题
我需要的中间栏是960px宽度和居中。当文档宽度高于960像素时,其他div列会出现,宽度将取决于宽度。
这里是一个图像
头部将包含背景颜色,在正确的,并在左边一个的图像重复-x的sideblocks。
编辑:它应该是IE9/8/7兼容。
<div class="wrapper">
<div class="left"></div>
<div class="central"></div>
<div class="right"></div>
</div>
.wrapper {
width:100%;
height:50px;
}
.central {
width:960px;
height:50px
margin:0 auto;
float:none;
background-color:#CCCCCC;
}
.left {
width:auto;
height:50px
float:none;
background-color:#ABC123;
}
.right {
width:auto;
height:50px
float:none;
background-color:#123456;
}
您需要什么兼容性? IE9/8/7?请在您的问题中指定此信息 – fcalderan 2013-04-29 11:18:17
Duplicate:http://stackoverflow.com/questions/114543/how-to-center-a-div-in-a-div-horizontally – 2013-04-29 11:18:37
@VimalStan不是真的;这是一个居中的div与背景在两侧,这是一个居中的div与两个其他divs在侧面... – 2013-04-29 11:42:55