4-3为什么蓝色广告在左边呢?

4-3为什么蓝色广告在左边呢?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
<title></title>
<style>
*{padding:0;margin:0;}
.bag{
width:100%;
height:4033px;
background:url("bag.png") center top no-repeat;
}
.list1{
width:100%;
height:364px;
background:url("list1.png") no-repeat;
top:50%;
left:0;
margin-top:-132px;
position:fixed;
}
.list2{
width:100%;
height:364px;
background:url("list2.png") no-repeat;
top:50%;
right:0;
margin-top:-132px;
position:fixed;
}
</style>
</head>
<body>
<div class="bag">
<div class="list1"></div>
<div class="list2"></div>
</div>
 
</body>
</html>


正在回答

登陆购买课程后可参与讨论,去登陆

1回答

2个广告的宽度不能设为100%,100%的话,左右定位就没有意义了。可以设为200px

http://img1.sycdn.imooc.com//climg/5a3b739e000119af08420572.jpg

问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师
插入代码