首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > CSS >

请问一个CSS样式布局的有关问题

2012-04-19 
请教一个CSS样式布局的问题style typetext/css#DIV1 {height: 100%width: 100%background-color: #

请教一个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的宽度

热点排行