Open this example in the interactive library
Source code
<style>
.demo {
width: min(65ch, calc(100% - 2rem));
margin-inline: auto;
}
</style>
<div class="demo">Set page width with a viewport gutter</div>
Set page width with a viewport gutter with native CSS. The preview includes a small shared demo stylesheet.
Open this example in the interactive library
<style>
.demo {
width: min(65ch, calc(100% - 2rem));
margin-inline: auto;
}
</style>
<div class="demo">Set page width with a viewport gutter</div>