最后一个自适应,那我们使用前两个float:left,他们在一行了,最后一个with:100%,但是我们需要指定margin-left,即左偏移left+center的width宽度,一开始我也是想right进行float:left,但是指定width宽度100%后,是向下一行,后来根据文档流模式,不使用float:left,直接使用margin-left即可
<!doctype html>
<html >
<head>
<meta charset="UTF-8">
<meta name="Description" content="">
<title>Document</title>
<style>
html,body{width:100%;height:100%;margin:0;padding:0;}
</style>
</head>
<body>
<div>
<div id="divleft" style="float:left; width:200px;height:100px;background:red;">left</div>
<div id="center" style="float:left;height:100px;width:100px;background:yellow" >center</div>
<div id="divright" style="margin-left:300px;width:100%;height:100px;background:blue;">right</div>
</div>
<div style="background:green;clear:both" >other</div>
</body>
</html>