div+css实现左侧固定宽度,右侧100%。以下是实例代码。
<!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 http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
*{padding:0px; margin:0px; }
body{ color:#FFF; font-size:24px; text-align:center;}
.left{ width:120px; height:1200px; float:left; margin-left:-130px; _margin-left:-65px; background:#F00; }
.right{ width:100%; height:300px; background:#36F; }
.container{ padding-left:130px; }
.foot{ width:100%; height:30px; background:#000; }
</style>
</head>
<body>
<div class="container">
<div class="left">左</div>
<div class="right">右</div>
<div style="clear:both"></div>
</div>
<div class="foot">footer</div>
</body>
</html>