亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

要求右側自適應,怎么回事啊

要求右側自適應,怎么回事啊

qiqiqiqi0 2015-10-25 11:08:14
.top{height:100px;background:#ccc;margin:0 auto}.main{height:600px;background:red;position:relative}.left{ height: 600px; width:200px; background: blue;? ? positive:absolute;top:0;left:0}.right{ height: 600px; width:100%; background: green; position:absolute; margin-left:210px; }.foot{height:50px;background:#F63;}
查看完整描述

2 回答

?
echo_kinchao

TA貢獻600條經驗 獲得超86個贊

左給定寬 ?然后右給百分比

查看完整回答
反對 回復 2015-10-26
?
淵翼

TA貢獻2條經驗 獲得超0個贊

width: 100%也就是說寬度跟父元素一樣寬,然后又加了一個margin-left:210px,結果所以就超出父元素啦。

所以可以把.right的樣式修改一下,最終代碼如下:

.top{
??height:?100px;
??background:?#ccc;
}
.main{
??height:?600px;
??background:?red;
??position:?relative
}
.left,?.right?{
??position:?absolute;
??top:?0;
??height:?100%;
}
.left{
??width:?200px;
??background-color:?blue;
??left:?0
}
.right{
??background-color:?green;
??left:?210px;
??right:?0;
}
.foot{
??height:?50px;
??background:?#F63;
}


查看完整回答
反對 回復 2015-10-25
  • qiqiqiqi0
    qiqiqiqi0
    中間分為2兩欄,其中,左側(left)寬度為200px, 右側(right)寬度自適應 他要求是寬度自適應
  • 2 回答
  • 0 關注
  • 1132 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號