一道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; }
原文地址:https://www.cnblogs.com/keke/p/1957041.html