【发布时间】:2022-01-19 16:30:54
【问题描述】:
我希望我的图像在倾斜块中的滚动条上滚动,但是一旦达到某个滚动级别,您就会开始看到出现空白。
我就是这样做的
.single-race__s2-container{
padding: 150px 0 300px;
background-size: cover;
background-repeat: no-repeat;
background-position: top;
background-attachment: fixed;
transform: skewY(-5deg);
margin-top: 150px;
margin-bottom: 1500px;
}
.single-race__s2-container:before{
content: '';
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
display:block;
background-color: rgba(0,0,0, 0.5);
}
.single-race__s2-content{
transform: skewY(5deg);
}
<div class="single-race__s2">
<div class="single-race__s2-container"
style="background-image: url('https://i.picsum.photos/id/355/1440/1000.jpg?hmac=QRHj9Ni2849l3Nfu1nLwhURgp2ncK9AsIsQZuXRHfVc')">
<div class="single-race__s2-content o-wrapper">
<p>Lorem ipsum dolor</p>
<span>test</span>
</div>
</div>
</div>
我这样做是正确的还是没有解决方案?
【问题讨论】:
-
你需要发布生成的代码,这样我们才能真正看到你所做的结果
-
我编辑了我的帖子,你应该更好地想象问题
-
我认为似乎有效
-
不,在卷轴上,我出现了一个空白
-
空白是由 margin-bottom 600px 产生的空白页面的一部分。我不确定你想要达到什么目的