Open this example in the interactive library
Source code
<style>
.demo {
overflow-y: auto;
scroll-padding-top: 1rem;
height: 6rem;
}
</style>
<div class="demo">
<a href="#end">Jump to end</a>
<p style="height: 8rem">Scrollable content</p>
<p id="end" style="min-height: 5rem">Target with top padding</p>
</div>