位置与nextjs粘在一起
我是新手的粘性,我以前没有使用过,所以我复制&将一些代码粘贴到我的项目中,但它不起作用。
<Layout title="Books">
<div className="container w-100 row">
<div className="sticky-top col-sm-3">
<Filter />
</div>
<div className="col-sm-9 ">
<Books />
</div>
</div>
<Footer />
</Layout>
im new to sticky and i didn't use it before, so i copy & paste some codes (about sticky sidebar) into my project but it doesn't work.
<Layout title="Books">
<div className="container w-100 row">
<div className="sticky-top col-sm-3">
<Filter />
</div>
<div className="col-sm-9 ">
<Books />
</div>
</div>
<Footer />
</Layout>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有现场预览,很难说。但是在使用
之前:
粘性;
几乎要记住:位置:
粘贴
如果祖先元素具有溢出
属性的以下值之一:hidden
,scroll
或auto
顶部
,右
,bottos
或左
的阈值, 。It's hard to tell without a live preview. But before using
position:
sticky;
there are few things to remember:position:
sticky
won't work if ancestor element has one of the following values for theoverflow
property:hidden
,scroll
, orauto
top
,right
,bottom
, orleft
for sticky positioning to behave as expected.