我有以下問題與三欄標題相關。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