最新回答 / 愛好學習的咸粽子
你肯定沒有試過,將,left和right的position:absolute屬性去掉,去掉后就發現只剩下left顯示,不存在你說的直接設置middle就ok的情況(建議用自己的編輯器,別直接用題目給的那個)
2018-02-19
.main{ width:970px; height:600px; margin:0 auto;border:1px solid red;}
.left{ width:300px; height:600px; background:#ccc; float:left;margin-left:5px;}/*左*/
.right{ width:660px; height:600px; background:#FECCCB; float:right;margin-left:5px;}/*右*/
</style>
把main的寬稍微加長點,再給里面的兩個div,用margin-left:5px;就可以了
.left{ width:300px; height:600px; background:#ccc; float:left;margin-left:5px;}/*左*/
.right{ width:660px; height:600px; background:#FECCCB; float:right;margin-left:5px;}/*右*/
</style>
把main的寬稍微加長點,再給里面的兩個div,用margin-left:5px;就可以了
.top{background:gray;
height:150px;
}
.main{background:red;
height:700px;
}
.left{
position:absolute;
top:150px;
left:0px;
background:blue;
height:700px;
width:200px;
}
.right{background:green;
height:700px;
margin-left:210px;
}
.foot{height:100px;background:orange;}
height:150px;
}
.main{background:red;
height:700px;
}
.left{
position:absolute;
top:150px;
left:0px;
background:blue;
height:700px;
width:200px;
}
.right{background:green;
height:700px;
margin-left:210px;
}
.foot{height:100px;background:orange;}