一道15分的css题
题目:在页面上有三个块,左右块的宽度高度固定,中间块宽度撑满在左右块之间,然后中间块的宽度可以跟着浏览器的变化而变化
答案一:
<div class="left">左</div>
<div class="right">右</div>
<div class="content">中</div>
.left {float:left;width:300px;height:500px;background:#F00;}
.right {float:right;width:200px;height:500px;background:#00F;}
.content {margin:0 200px 0 300px;height:500px;background:#CCC;}
答案二:
<body>
<div class="left fl">左</div>
<div class="body">中</div>
<div class="right fr">右</div>
</body>
.left,.right{ width:100px; height:200px; position:absolute; background:red; }
.fl{ left:0px; }
.fr{ right:0px; }
.body{ position:absolute; left:100px; right:100px; background:#ccc; }