我試圖得到與頁眉,頁腳和兩列的佈局。 網站的寬度必須與屏幕分辨率和高度有關。 右列應該有250px的寬度。如果內容很大,左列(內容)應該有一個垂直滾動條。內容div剩餘高度
換句話說,頁眉,頁腳和右側應始終可見並固定。如果需要,內容應該有垂直滾動條。
感謝
編輯:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
<style type="text/css">
body {
font: 11px Tahoma, Arial;
margin: 0;
padding: 0;
color: #3d5770;
background-color: #A7A7A7;
}
#wrapper
{
min-width: 987px;
margin-left: auto;
margin-right: auto;
width: 98%;
}
#header
{
background-color: orange;
clear: both;
float: left;
width: 100%;
height:100px;
background-color: orange;
}
#main
{
width: 100%;
background-color: White;
}
#footer
{
position: absolute;
bottom: 0px;
height: 30px;
clear:both;
background-color: aqua;
margin-left: auto;
margin-right: auto;
width: 98%;
}
#content
{
position: absolute;
top: 100px;
bottom: 30px;
overflow: auto;
margin-right: 262px;
background-color: White;
}
#right
{
width: 245px;
float: right;
}
#rightInner
{
position: absolute;
top: 100px;
bottom: 30px;
width: 244px;
background-color: Lime;
}
</style>
</head>
<body>
<div id="wrapper">
<div id="header">header</div>
<div id="main">
<div id="right">
<div id="rightInner">Banners</div>
</div>
<div id="content">Dynamic content Dynamic content Dynamic content Dynamic content Dynamic content Dynamic content Dynamic content </div>
</div>
<div id="footer">footer</div>
</div>
</body>
</html>
正如你所看到的,內容是DIV增長horizontaly和高度是屏幕的最大高度。這部作品在我的22" 畫面精美,但是當我改變屏幕尺寸,我得到一點點分裂在我的內容和正確的格之間的屏幕...
你有任何我們可以看的代碼嗎?有很多地方都有這方面的例子 - 一個可能的鏈接:http://www.456bereastreet.com/lab/developing_with_web_standards/csslayout/2-col/ –
你的問題是什麼?你試過了什麼? – Polynomial
我認爲http://rentacoder.com更適合這個。 – deviousdodo