老師 請看哪裡需要改善
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style type="text/css">
.page{
width: 1905px ;
height:4050px;
background: url(http://img1.sycdn.imooc.com/climg//59c9f7ce0001839219034033.png);
position: relative;
}
.adLeft{
width: 224px;
height: 346px;
background: url(http://img1.sycdn.imooc.com/climg//5a3383d00001a3dd02240364.png);
position: fixed;
top: 300px;
}
.adRight{
width: 224px;
height: 346px;
background: url(http://img1.sycdn.imooc.com/climg//5a3383c70001f1b702240364.png);
position: fixed;
top: 300px;
right: 0px;
}
</style>
<title></title>
</head>
<body>
<div class="page">
<div class="adLeft"></div>
<div class="adRight"></div>
</div>
</body>
</html>請問關於我寫的top: 300px; 是我用幾個數字測出來的,有更好的寫法嗎?
有辦法準確知道視口垂直正中間距離視口上方的像素高度是多少呢?
13
收起
正在回答
2回答
同学你好,body是标签,不是class类,所以前面不需要加点。参考修改

还有左右两侧小盒子高度应该是364px,一半才是182px

自己再测试下,祝学习愉快!





恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星