微信小程序开发中为父元素设置背景图,子元素不能滚动
<style>
.fu{
background:url("https://xxx.png");
width:100%;
height:100vh;
background-size: 100% 100%;
background-repeat: no-repeat;
z-index: -999;
position: fixed;
}
.zi{
width:70%;
height:120vh;
background:red;
}
</style>
<view class="fu">
<scroll-view class="zi"></scroll-view>
</view>
<view class="fu"></view>
<scroll-view class="zi"></scroll-view>
子元素继承父元素属性,导致背景绝对定位无法滑动!