定位banner上文字的滚动

banner上的文字滚动向上,banner图基本不动,但是下面的内容滚动的时候还是会把banner图覆盖
<section class="banner-box">

<img src="../images/bg.jpg" alt=""class="img">
 <div class="font-box">
   ssss
 </div>

</section>
<section class="introduce-box">

</section>

// banner开始
.banner-box{
width: 100%;
height: 100px;
// background:url("../images/bg.jpg")no-repeat fixed center;
position: fixed;
.img{

width: 100%;
text-align: center;

}
.font-box{

// position: fixed;
background: red;
z-index: 2;

width: 919px;
height: 218px;

}
}
// banner结束
.introduce-box{
width: 100%;
height: 500px;

}

阅读 3.4k
1 个回答

你应该将需要滚动的图片和文字放在同一个div下,然后滚动div。建议你最好将需要滚动的图片设置成背景图。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题