JavaScript
1
Вклад в тег
const id = 'block';
const yOffset = -50;
const element = document.getElementById(id);
const y = element.getBoundingClientRect().top + window.pageYOffset + yOffset;
window.scrollTo({top: y, behavior: 'smooth'});