更新: 我正在授予50的獎勵誰可以幫助我實現this design。爲什麼這個CSS Full Height Layout不能正確顯示?
所以我一直在嘗試過去2-3小時來解決這個問題,但似乎無法做到這一點。也許有CSS或jQuery體驗的人可以幫助我。我正在嘗試accomplish this。這是my result。問題是,當我調整瀏覽器窗口的大小時,B列的內容被截斷,A列左側有一個額外的空白空間,以節省您的時間。
CSS:
#public {
width:100%;
}
#publiC#container {
position:absolute;
width:100%;
height:100%;
left:0;
top:0;
min-width:1050px;
}
#public .left {
float:left;
width:40%;
height:100%;
background-color:#fff;
}
#public .left .content {
float:right;
width:365px;
margin-top:20px;
text-align:center;
}
#public .left .platforms {
margin-top:40px;
}
#public .left .aila {
display:block;
margin-top:25px;
}
#public .left .copy {
margin-top:20px;
color:#171515;
font:bold 12px Arial, Verdana;
}
#public .right {
float:right;
width:60%;
height:100%;
overflow:hidden;
}
#public .right .content {
float:left;
width:665px;
min-height:704px;
margin-top:20px;
background:url(images/public-right-shadow.png) no-repeat left top;
}
HTML:
<div id="public">
<div id="container">
<div class="left">
<div class="content">
<img src="images/logo2.png" alt="" class="logo" />
<img src="images/supported-platforms.png" class="platforms" />
<div class="copy">© all right reserved 2012</div>
</div>
</div><!--.left-->
<div class="right">
<div class="content">
Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here. Right column here.
</div>
</div><!--.right-->
</div><!--#container-->
</div><!--#public-->
嘗試從#containers css定義中刪除「position」屬性。另外,如果你這樣做,那麼「頂」和「左」屬性也可以去。我不認爲你需要他們來實現你想要的。 – antony
其實,如果你刪除絕對定位,我不認爲#容器定義中的任何規則都應該在那裏。寬度和高度不會有任何影響,因爲高度只有在其父元素具有設置高度時才起作用,並且寬度將自動爲塊元素的100%。 – antony
感謝您的回覆,但如果我刪除這些屬性,背景圖像將不會一路走到底部。此外,它對我的問題沒有影響。 – Cris