gpt4 book ai didi

html - 滚动行为平滑根本不起作用

转载 作者:行者123 更新时间:2023-12-03 20:06:05 25 4
gpt4 key购买 nike

我想知道为什么我的滚动平滑根本不起作用。我不太确定为什么?我想添加 overflow-y: scroll; scroll-behavior: smooth;会有所帮助,但它不起作用。这是我的代码:

#container{
overflow-y: scroll;
scroll-behavior: smooth;
}
.topTab{
bottom: 0;
position: fixed;
font-size: 25px;
color: white;
}
.pg{
font-size: 100px;
height: 100vh;
background-color: blue;
text-align: center;
}

a{
color: white;
}
<div class = "topTab">
<li><a href="#1">1</a></li>
<li><a href="#2">2</a></li>
<li><a href="#3">3</a></li>
</div>

<div id = "container">
<div id = "1" class= "pg">1</div>
<div id = "2" class = "pg">2</div>
<div id = "3" class = "pg">3</div>
</div>

最佳答案

我在现代 Chrome 中遇到了同样的问题(例如在 88.0.4324.182 版本中),但我随后启用了 smooth scrolling使用下面提到的 URL 标记:

chrome://flags/#smooth-scrolling 

关于html - 滚动行为平滑根本不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62098093/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com