Open this example in the interactive library
Source code
<style>
.demo {
overflow-y: auto;
scrollbar-gutter: stable;
height: 4rem;
}
</style>
<div class="demo">Reserved gutter<br />Short content</div>
Reserve room for a scrollbar with native CSS. The preview includes a small shared demo stylesheet.
Open this example in the interactive library
<style>
.demo {
overflow-y: auto;
scrollbar-gutter: stable;
height: 4rem;
}
</style>
<div class="demo">Reserved gutter<br />Short content</div>