最新回答 / 慕神0129940
1.應該是margin:0 ? ? ? 2.漏了</style> ? ? ? ?3</div> 應該緊接著<div class="lee">后面
2020-02-18
剛剛寫的那個有問題,感覺css很難學啊 .top{background:#ccc;height:50px;} .main{height:500px;background:#ff0000;position:relative;} .left{height:500px;width:200px;background:#0000FF;position:absolute;left:0px;top:0px;} .right{height:500px;margin-left:210px;background:#66CDAA;} .foot{background:#FF7256;height:50px;}
分享一下
.top{background:#ccc;height:50px;}
.main{height:500px;background:#ff0000;position:relative;}
.left{height:500px;width:200px;background:#0000FF;float:left;}
.right{height:500px;position:absolute;left:210px;background:#66CDAA;width:100%;}
.foot{background:#FF7256;height:50px;}
.top{background:#ccc;height:50px;}
.main{height:500px;background:#ff0000;position:relative;}
.left{height:500px;width:200px;background:#0000FF;float:left;}
.right{height:500px;position:absolute;left:210px;background:#66CDAA;width:100%;}
.foot{background:#FF7256;height:50px;}
body{ margin:0; padding:0; font-size:30px; background-color:red}
.top{height:100px; background:#ccc}
.left{ width:200px; height:500px; background:blue;position:absolute;top:100px;left: 0; }
.right{ margin-left:210px;height:500px; background:#9C9;}
.foot{ height:100px;background:#F63;clear:both;}
.top{height:100px; background:#ccc}
.left{ width:200px; height:500px; background:blue;position:absolute;top:100px;left: 0; }
.right{ margin-left:210px;height:500px; background:#9C9;}
.foot{ height:100px;background:#F63;clear:both;}
最新回答 / 陳冠瑋
就把righe 標簽 寫在前面呀 ~ 他本來的代碼 就是把 right 寫在前面的! 你只需要絕對定位 left ?,然后right 用margin-left:210px;就好了
2019-09-20
最新回答 / 慕用8339455
注意float與position的區別:float僅僅只是將元素浮動到左邊或者右邊,沒有任何數值要求但是當有數值要求時,用絕對定位position更加精確
2019-09-16
最贊回答 / 行云LS
因為是先加載right后加載left,right沒有浮動,因此要占一整行,left就被擠下去了。要達到效果可以把left變為絕對定位。代碼如下<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>混合布局編程挑戰</title><style typ...
2019-08-02