代码如下:
<!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>两侧列固定中间列变宽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>
生活中到处都存在着缘分,缘聚缘散好像都是命中注定的事情;有些缘分也许从一开始就注定要失去,有些缘分也许是永远都不会有结果;</p>
<p>
可是我却偏偏渴望创造一种奇迹。也许不是不曾心动,不是没有可能,只是有缘无份,情深缘浅,如果彼此出现早一点,也许就会有美好的结局,又或者相遇的时间再晚一点,晚到两个人在各自的爱情故事中经历了包容与体谅,善待和妥协,悲痛与快乐,到了那时也许走到一起就会有可能。</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>