4-3编程问题

来源:4-3 编程练习

那是个圈A

2017-10-07 21:58:17

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
<title></title>
<style>
   *{
       margin:0px;
       padding:0px;
   }
   .all{
       width:100%;
       height:10000px;
       background: url(http://climg.mukewang.com/59c9f7ce0001839219034033.png) center top no-repeat;
   }
   .left{
       width:260px;
       height:260px;
       background: url(http://climg.mukewang.com/58c112ed0001370f03000300.jpg);
       position:fixed;
       left:0px;
       top:50%;
       margin-top:-50px;
       
   }
   .right{
       width:260px;
       height:260px;
       background: url(http://climg.mukewang.com/58c112ed0001370f03000300.jpg);
       position:fixed;
       right:0px;
       top:50%;
       margin-top:-50px;
   }
</style>
</head>
<body>
<div class="all">
   <div class="left"></div>
   <div class="right"></div>
</div>
</body>
</html>

老师我已经弄出相应的效果,只是想问一下,针对对联广告中的左侧广告块和对联广告的右侧广告块。我们这样固定定位属性,是因为他的width和height都被固定了,所以要移动整体必须用固定定位。如果这个框足够大,那么我就可以使用margin:auto 0px;或者background:left center;这样的方式去移动广告块了对么?

写回答

1回答

樱桃小胖子

2017-10-08

不是很理解你的意思,建议你再详细的描述一下你的问题。祝学习愉快!

0

0 学习 · 36712 问题

查看课程

相似问题

4-3编程问题

回答 1

4-3编程问题

回答 1

4-3编程问题

回答 1

4-3编程疑问

回答 2

4-3编程问题

回答 3