為什么我的塊寬度要減去210px
朋友們哪,為什么我的藥這樣才行,否則right會比top和foot寬移動的那210px
.top{width:100%;height:100px;background:#ccc;margin:0 auto;}
.main{width:100%;height:600px;background:red;position:relative;margin:0 auto;}
.left{width:200px;height:600px;background:blue;position:absolute;}
.right{width:100%-220px;height:600px;margin-left:220px;background:green;float:left;}
.foot{width:100%;height:100px;background:orange;margin:0 auto;}
2016-02-18
瀏覽器不能識別width:100%-220px;
2016-02-14
左側使用絕對定位脫離父元素的文檔流,
右側的div默認寬度為父元素的寬度,只需要設置左外邊距為相應的數值100%減去移動的210px,是這樣理解的嗎?