CSS+DIV,左右2个DIV,左边固定宽度,右边如何自动延伸?(如下例,左边必须是固宽,黄块如何自动延伸)

<div style="width:100%;height:50px;background:red;"></div>
<div style="float:left;width:200px;height:500px;background:blue;"></div>
<div style="float:left;width:700px;height:500px;background:yellow;"></div>

左边固定,右边自适应:

<div style="height:300px;background:green">
    <div style="width:200px; height:300px; float:left; background:red">aside</div>
    <div style=" margin-left:200px">content</div>
</div>

左边固定,右边自适应(圣杯布局的实现):

<style type="text/css">
body{margin:0;padding:0}
.wrap{ width:100%; float:left}
.content{ height:300px;background:green; margin-left:200px}
.right{ width:200px; height:300px; background:red; float:left; margin-left:-100%}
</style>
<div class="wrap">
<div class="content">content</div>
</div>
<div class="right">aside</div>
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答