對不起,我的英語。如何..中間有三個中間的div,如果導航員調整大小
請,我有一個divs的問題,我有3個「圖像」水平,圖像必須在一起。
這是默認視圖,如果屏幕足夠大。
如果導航器調整大小,我失去了與#div2中心。 #div1與左邊對齊,那不是我需要的。
我需要的是#div2留在中心,但我不知道這樣做。 #div1和#div3在導航器外部,沒有一個div可以調整大小,是固定的大小。
的HTML代碼:
<body id="body">
<div id="wrap">
<div id="baseLeftBg">
</div>
<div id="baseContent">
</div>
<div id="baseRightBg">
</div>
</div>
</body>
的CSS代碼:
#body {
text-align: center;
height: 100%;
margin: 0 auto;
padding: 0px;
background: #ffffff;
-moz-background-size: cover;
background-size: cover;
float: inherit;
}
#wrap {
width: 1484px;
margin: 0 auto;
text-align:center;
}
#baseLeftBg {
margin-top: 60px;
background: #CDCDCD;
width: 286px;
height: 776px;
float: left;
}
#baseContent {
margin-top: 60px;
background: #A7A7A7;
width: 911px;
height: 776px;
float: left;
}
#baseRightBg {
margin-top: 60px;
background: #CDCDCD;
width: 286px;
height: 776px;
float: left;
}
我怎樣才能做到這一點?
鏈接小提琴:http://jsfiddle.net/murb83/BChLs/
謝謝!
我想你想中間div固定和左右靈活? – jackJoe 2012-07-10 11:22:09
三個divs必須在一起,但是如果我調整屏幕的大小,中間div必須永遠在中間,其他人可以先在導航器 – murb83 2012-07-10 11:26:07
之外走,就好像所有的錨點位於# DIV2。我希望我解釋得很好。 – murb83 2012-07-10 11:28:25