先加载left,后加载right涉及到js和jquery了吧?从别处抄了段过来,但还是不懂...
<script type="text/javascript">
function show(){
if($("#right").css("display") == "none") {
$("#right").show();
}
else if($("#left").css("display") == "none") {
$("#left").show();
}
}
<script type="text/javascript">
function show(){
if($("#right").css("display") == "none") {
$("#right").show();
}
else if($("#left").css("display") == "none") {
$("#left").show();
}
}
.top{background-color:#ccc;height:100px;}
.main{background-color:#f00;height:400px;}
.left{background-color:#00f;width:200px;height:400px;position:absolute;left:0;}
.right{background-color:#e4f;height:400px;width:100%;position:absolute;left:210px;}
.foot{background-color:#fc4;height:100px;}
.main{background-color:#f00;height:400px;}
.left{background-color:#00f;width:200px;height:400px;position:absolute;left:0;}
.right{background-color:#e4f;height:400px;width:100%;position:absolute;left:210px;}
.foot{background-color:#fc4;height:100px;}
已采纳回答 / liuliyuanstar
.left{ width:300px; height:600px; background:#ccc; float:left;}} 最后面多了个“}”。
2015-07-13
.top{height:100px;background:gray;}
.main{height:400px;width:800px;background:red;margin:0 auto;}
.left{height:400px;width:250px;float:left; background:blue;}
.right{height:400px;width:530px;float:right;background:green;}
.foot{height:100px;width:800px;background:navy;margin:0 auto;clear:both;}
.main{height:400px;width:800px;background:red;margin:0 auto;}
.left{height:400px;width:250px;float:left; background:blue;}
.right{height:400px;width:530px;float:right;background:green;}
.foot{height:100px;width:800px;background:navy;margin:0 auto;clear:both;}