代碼如下:
<!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>
<title>兩側(cè)列固定中間列變寬2</title>
<meta http-equiv=content-type content=text/html; charset=utf-8 />
<style type=text/css>
body{
font:12px/18px arial;
margin:0;
}
#header,#footer {
background:#ccccff;
width:85%;
margin:0 auto;
}
#nav {
background:#dfc0ff;
width:85%;
margin:0 auto;
}
h2{
margin:0;
padding:20px;
}
p{
padding:15px 20px;
text-indent:2em;
margin:0;
}
#container {
width:85%;
margin:0 auto;
background:url(images/background-right.gif) repeat-y top right;
position: relative;
}
#innercontainer {
background:url(images/background-left.gif) repeat-y top left;
}
#navi {
width: 200px;
position: absolute;
left: 0px;
top: 0px;
}
#content {
right: 0px;
top: 0px;
margin-right: 200px;
margin-left: 200px;
}
#side {
width: 200px;
position: absolute;
right: 0px;
top: 0px;
}
</style>
</head>
<body>
<div id=header>
<h2>page header</h2>
</div>
<div id=container>
<div id=innercontainer>
<div id=navi>
<h2>navi bar</h2>
<ul>
<li>home</li>
<li>web design</li>
<li>web dev</li>
<li>map</li>
<li>contact us</li>
<li>home</li>
<li>web design</li>
</ul>
</div>
<div id=content>
<h2>page content</h2>
<p>
生活中到處都存在著緣分,緣聚緣散好像都是命中注定的事情;有些緣分也許從一開始就注定要失去,有些緣分也許是永遠都不會有結(jié)果;</p>
<p>
可是我卻偏偏渴望創(chuàng)造一種奇跡。也許不是不曾心動,不是沒有可能,只是有緣無份,情深緣淺,如果彼此出現(xiàn)早一點,也許就會有美好的結(jié)局,又或者相遇的時間再晚一點,晚到兩個人在各自的愛情故事中經(jīng)歷了包容與體諒,善待和妥協(xié),悲痛與快樂,到了那時也許走到一起就會有可能。</p>
</div>
<div id=side>
<h2>side bar</h2>
<ul>
<li>web dev</li>
<li>map</li>
<li>contact us</li>
</ul>
</div>
</div>
</div>
<div id=footer>
<h2>page footer</h2>
</div>
</body>
</html>