【发布时间】:2021-08-27 02:46:32
【问题描述】:
我正在尝试制作一个流畅的滚动程序,它可以工作,但我想要一个动画按钮。
这是我的代码:
html {
scroll-behavior: smooth;
}
#section1 {
height: 800px;
background-color: red;
}
#section2 {
height: 800px;
background-color: blue;
}
<h1>Smooth Scroll</h1>
<div class="main" id="section1">
<h1>Section 1</h1>
<a href="#section2">Section 2 </a>
</div>
<div class="main" id="section2">
<h1>Section 2</h1>
<a href="#section1">Section 1</a>
</div>
我想要这样的东西-
有没有办法只使用 HTML 和 CSS 来做到这一点?
【问题讨论】:
标签: html css css-animations