Html 如何删除视差内滚动条
我试图在我的网站上的“关于我们”页面上添加视差效果。我设法用纯css创建了效果,但是在Html 如何删除视差内滚动条,html,css,parallax,Html,Css,Parallax,我试图在我的网站上的“关于我们”页面上添加视差效果。我设法用纯css创建了效果,但是在容器中出现了一个内部滚动条 另外,这是在magento商店中,我无法更改maindiv 这是我的html <div class="container"> <div class="parallax-wrapper"> <div class="section parallax bg1"><span>Your Passion Is Our Passio
容器中出现了一个内部滚动条
另外,这是在magento商店中,我无法更改main
div
这是我的html
<div class="container">
<div class="parallax-wrapper">
<div class="section parallax bg1"><span>Your Passion Is Our Passion!</span></div>
<div class="section static">
<p>Since more than 12 years ....</p>
</div>
<div class="section parallax bg2"><span>Large Choice Of Products</span></div>
<div class="section static">
<p>We are proud to offer you a large variety of products for every budget and taste.</p>
</div>
<div class="section parallax bg3"><span>Dedicated Customer Service</span></div>
<div class="section static">
<p>Our staff's only goal is to offer you a unique and professional experienxe.</p>
</div>
<div class="section parallax bg1"><span>Happy Shopping!</span></div>
</div>
</div>
我希望当用户滚动整个页面时,视差效果会有效,而不是我用代码意外创建的内部滚动条。添加了正文
css
正文{
边距:0px;/*已添加此边距*/
}
.视差包装{
高度:100vh;
溢出x:隐藏;
溢出y:自动;
透视图:2px;
}
.科{
位置:相对位置;
高度:500px;
显示器:flex;
对齐项目:居中;
证明内容:中心;
颜色:白色;
文本阴影:0 0 5px#000;
}
视差{
内容:“;
位置:绝对位置;
排名:0;
右:0;
底部:0;
左:0;
变换:translateZ(-1px)比例(1.5);
背景大小:100%;
z指数:-1;
}
.静态{
背景:红色;
高度:200px;
}
.bg1::之后{
背景图片:url(https://loremflickr.com/320/240);
}
你的激情就是我们的激情!
12年多以来
产品种类繁多
我们自豪地为您提供各种各样的产品,满足您的各种预算和口味
专门的客户服务
我们员工的唯一目标是为您提供独一无二的专业体验
购物愉快!
正文已经由magento生成,我无法更改html代码,因为它会影响整个网站。我尝试添加一个特定于Pralax的css类,并在css中使用它,但它没有改变任何东西。谢谢,我知道,但是如果我修改body css类,它将影响我所有的网站。通过向主体添加一个类,我可以修改它,而不会影响它不工作的所有内容。
.parallax-wrapper{
height: 100vh;
overflow-x: hidden;
overflow-y: auto;
perspective: 2px;
}
.section{
position: relative;
height: 500px;
display: flex;
align-items: center;
justify-content: center;
color: white;
text-shadow: 0 0 5px #000;
}
.parallax::after{
content: " ";
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
transform: translateZ(-1px) scale(1.5);
background-size: 100%;
z-index: -1;
}
.static {
background: red;
height: 200px;
}
.bg1::after {
background-image: url(/app/design/frontend/TemplateMonster/md/web/images/bg1.jpg);
}
.bg2::after {
background-image: url(/app/design/frontend/TemplateMonster/md/web/images/bg2.jpg);
}
.bg3::after {
background-image: url(/app/design/frontend/TemplateMonster/md/web/images/bg3.jpg);
}