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 星
前端小白入门系列课程
  • 参与学习           人
  • 提交作业       11218    份
  • 解答问题       36713    个

从一个不会编程的小白到一个老司机是需要过程的,首先得入门,学习基础知识,然后才能进阶,最后再到精通,本专题是你走进前端世界的不二选择!

了解课程
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

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