What I'm trying to do is make it so that if you click on a button, it scrolls down (smoothly) to a specific div on the page.
我需要的是,如果你点击按钮,它会平滑地滚动到div'second'.
.first {
width: 100%;
height: 1000px;
background: #ccc;
}
.second {
width: 100%;
height: 1000px;
background: #999;
}
<div class="first"><button type="button">Click Me!</button></div>
<div class="second">Hi</div>