bottom document.getElementById("right").style.height=document.getElementById("middle").scrollHeight+"px";document.getElementById("left").style.height=document.getElementById("middle").scrollHeight-0+"px"...
css div 母版页布局的代码怎么写?
<html>
<head>
<style>
body{
margin:0px;
padding:0px;
text-align:center;
font-family:"宋体", "新宋体";
background-color:#ffffff;
}
#container{
width:800px;
height:auto;
position:relative;
text-align:left;
margin:0px auto;
padding:0px;
}
#top{
height:50px;
width:800px;
background-color:#090;
}
#middle{
margin-top:10px;
width:800px;
height:auto;
overflow:hidden;
}
#left{
margin:0px 0px 0px 10px;
background-color:#3F0;
width:250px;
float:left;
display:inline;
}
#right{
margin:0px 10px 0px 0px;
background-color:#30F;
width:400px;
float:right;
display:inline;
height:100px;
}
#bottom{
width:780px;
margin:10px 0px 0px 10px;
clear:both;
height:70px;
background-color:#0C0;
}
</style>
</head>
<body>
<div id="container">
<div id="top">
top
</div>
<div id="middle">
<div id="left">
left
</div>
<div id="right">
right
</div>
</div>
<div id="bottom">
bottom
</div>
</div>
<script type="text/javascript">
document.getElementById("right").style.height=document.getElementById("middle").scrollHeight+"px";
document.getElementById("left").style.height=document.getElementById("middle").scrollHeight-0+"px";
</script>
</body>
</html>
right 里面加内容的话 left会一起拉长 你可以加 br 测试
注意的是 right要固定高度
middle:height:auto;overflow:hidden; 要加上这2个
满意的话加分谢谢^^2009-08-11
不要设定高度就可以了2009-08-11