日期:2014-05-17  浏览次数:20702 次

请教一个CSS样式布局的问题
<style type="text/css">
#DIV1 {
height: 100%;
width: 100%;
background-color: #900;
}
#divLeft {
float: left;
height: 100%;
width: 200px;
background-color: #FF0;
}
#divAll {
background-color: #F0F;
float: left;
height: auto;
width: auto;
}
</style>
<div id="DIV1">
  <div id="divLeft">此处显示 id "divLeft" 的内容</div>
  <div id="divAll">此处显示 id "divAll" 的内容</div>
此处显示id "DIV1" 的内容</div>

DIV1里有两个DIV,
divLeft的宽度必须为200px,余下的空间让divAll填满,应该怎么写CSS才对啊

------解决方案--------------------
<style type="text/css">
#DIV1 {
width: 100%;
background-color: #900;
position:relative;
}
#divLeft {
float: left;
height: 100%;
width: 200px;
background-color: #FF0;
position:absolute;
left:0px;
top:0px;
}
#divAll {
background-color: #F0F;
margin-left:200px;
}
</style>
只需要改一下css,利用定位来实现
------解决方案--------------------
”此处显示id "DIV1" 的内容"请问你这句话怎么处理
------解决方案--------------------
这个有点需求不清晰的感觉,你那样也差不多了。。呵
------解决方案--------------------
js动态控制divAll的宽度