1.實現(xiàn)上、左、右三塊組成樣式的全屏布局?2.A區(qū)和B區(qū),也要能夠在指定的區(qū)域內(nèi)實現(xiàn) height:100%,但不得超出邊界。 紅色:div1藍色:div2黃色:div3A區(qū):div4B區(qū):div5
3 回答

萬千封印
TA貢獻1891條經(jīng)驗 獲得超3個贊
<!doctype html>
<html>
<head></head>
<style>
#all{
width:100%;
height:100%;
}
#left{
position:absolute;
background-color:#3aadf0;
float:left;
width:50%;
height:100%;
}
#right{
position:absolute;
background-color:red;
float:right;
width:50%;
height:100%;
margin-left:50%; <!--設置內(nèi)邊距即可,樓主的問題同理可得-->
}
#right a img{
width:300px;
height:300px;
float:left;
margin-top:35%;
margin-bottom:35%;
}
</style>
<body>
<div id="all">
<div id="left">
</div>
<div id="right">
</div>
</div>
</body>
</html>
- 3 回答
- 0 關注
- 1164 瀏覽
添加回答
舉報
0/150
提交
取消