我如何才能使卷轴nap型与React正确使用?
我有一个反应应用程序,如下所示:
function App() {
return (
<div className="app">
<Topbar/>
<div className="sections">
<Intro/>
<Portfolio/>
<Works/>
<Contact/>
</div>
</div>
);
}
4 个部分的组件有一个 css 文件,如下所示:
.intro{
background-color: rgb(243, 208, 208);
width: 100vw;
height: calc(100vh - 70px);
scroll-snap-align: start;
}
app.js css 文件如下所示:
.app{
height: 100vh;
.sections{
width: 100%;
height: calc(100vh-70px);
background-color: rgb(105, 179, 130);
position: relative;
top: 70px;
scroll-snap-type: y mandatory;
}
}
本质上每个组件都是一个全尺寸的页面,其想法是进行快速滚动。有谁知道为什么我似乎无法让它工作?谢谢!
I have a react app as follows:
function App() {
return (
<div className="app">
<Topbar/>
<div className="sections">
<Intro/>
<Portfolio/>
<Works/>
<Contact/>
</div>
</div>
);
}
The 4 sections components have a css file as so:
.intro{
background-color: rgb(243, 208, 208);
width: 100vw;
height: calc(100vh - 70px);
scroll-snap-align: start;
}
And the app.js css file looks like so:
.app{
height: 100vh;
.sections{
width: 100%;
height: calc(100vh-70px);
background-color: rgb(105, 179, 130);
position: relative;
top: 70px;
scroll-snap-type: y mandatory;
}
}
Essentially every components is a full sized page, and the idea is to have snap scrolling. Does anyone know why I can't seem to get it to work? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论