61,112
社区成员
发帖
与我相关
我的任务
分享
<div id="left"> </div><div id="center"> </div><div id="right"> </div>
#left { width:35px; float:left; }
#center { float:left; }
#right { width:35px; }
<style>
body {margin:0px; padding:0px;}
#left { width:35px; float:left; height:100px; background:#ccccce;}
#center { float:left; background:#cff;}
#right { width:35px;height:100px; background:#ccccce; float:right;}
</style>
<script type="text/javascript">
function $(id){
return document.getElementById(id)
}
window.onload=function(){
var cW=document.compatMode=="CSS1Compat"?document.documentElement.clientWidth:document.body.clientWidth;//alert(cW)
var lW=$("left").offsetWidth;
var rW=$("right").offsetWidth;
$("center").style.width=(cW-lW-rW)+"px";
}
</script>
<div id="left"> </div><div id="center"> </div><div id="right"> </div>