СправошнаяПоиск

Плавная прокрутка на CSS

@keyframes smoothscroll1 {
  from, to {
    scroll-behavior: smooth;
  }
}
@keyframes smoothscroll2 {
  from, to {
    scroll-behavior: smooth;
  }
}
html {
  animation: smoothscroll1 1s;
}
html:focus-within {
  animation-name: smoothscroll2;
  scroll-behavior: smooth;
}