這是可以做到如果一定的高度是已知的。
小提琴:http://jsfiddle.net/BramVanroy/Pt7sS/
的#contentWrap
和#sideRight
高度需要了解,使這項工作。如果這些不知道,你可以通過jQuery獲取高度。
html, body, #header1, #header2, #contentWrap {
width: 100%
}
#header1 {
background: red;
height: 50px
}
#header2 {
background: green;
height: 40px
}
#sideLeft, #main, #sideRight {
box-sizing: border-box;
float: left;
height: 200px
}
#sideLeft, #sideRight {
width: 20%;
background: #333
}
#main {
background: grey;
width: 60%
}
@media screen and (max-width: 768px) {
#main {
float: right;
width: 65%
}
#sideRight {
clear: left
}
#sideRight, #sideLeft {
width: 35%;
height: 100px
}
}
@media screen and (max-width: 480px) {
#sideLeft, #main, #sideRight {
float: none;
width: 100%;
position: absolute
}
#contentWrap {
position: relative;
height: 400px
}
#main {
top: 0
}
#sideLeft {
bottom: 100px
}
#sideRight {
bottom: 0
}
}
很難說沒有代碼它有什麼問題。你可以發佈一些代碼嗎?另外,你是否使用CSS媒體查詢? – 2012-08-06 07:29:54
我剛剛使用Dreamweaver在選擇「流體網格佈局」時放出的內容。試圖發佈代碼,但它太長了 – user1578421 2012-08-06 07:37:33