HTML:兩欄佈局,內容第一
<div id="main">
<div id="sidebar"></div>
<div id="content"></div>
</div>
CSS:
#content {
background: blue;
height: 900px;
}
#sidebar {
float: left;
width: 200px;
height: 900px;
background: red
}
的jsfiddle:http://jsfiddle.net/aFrPc/
雖然這個作品,我想有#content
第一上市(而不是#sidebar
)。 Div#內容必須填滿所有剩餘空間。最終通緝的結果的
圖片:
所以,你說你要'在右側,而左側content'? – taylorc93
只需將'float:left;'更改爲'float:right;'如果您想在右邊輸入內容 – 1andsock
您的意思是「首先列出」是什麼意思?如果你的意思是你想''content'在左邊,你只需要'#content''float:left'而不是'#sidebar'。或者,也許我不理解你的問題(工作日幾乎結束,我的大腦不是100%;)) – David