題目:在頁(yè)面上有三個(gè)塊,左右塊的寬度高度固定,中間塊寬度撐滿(mǎn)在左右塊之間,然后中間塊的寬度可以跟著瀏覽器的變化而變化
答案一:
<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{ width:100%; position:absolute; left:100px; right:100px; background:#ccc; }
如對(duì)本文有疑問(wèn),請(qǐng)?zhí)峤坏浇涣髡搲?,廣大熱心網(wǎng)友會(huì)為你解答!! 點(diǎn)擊進(jìn)入論壇