Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<head>
<style>
#container {
  width: 80%;
  aspect-ratio: 2/1;
  margin: auto;
  border: solid black 2px;
  overflow-x: hidden;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
}
.blue {
  background-color: lightblue;
  width: 95%;
  aspect-ratio: 3/1;
}
.green {
  background-color: lightgreen;
  width: 80%;
  aspect-ratio: 4/1;
}
.blue, .green {
  margin: 2px;
  scroll-snap-align: start none;
  scroll-margin-inline: 20px 0;
  writing-mode: vertical-rl;
}
</style>
</head>
<body>
<h3>CSS scroll-margin-inline property.</h3>
<p>With the writing-mode property value set to vertical-rl the start of the element in the inline direction is changed from left to top, and this also affects the scroll-margin-inline property.</p>
<p>In this example, snap position is set to start in block direction. To make a margin between child elements and container in this snap position, with writing-mode vertical-rl, the scroll-margin-inline property start value is set to 20px.</p>
<div id="container">
  <div class="blue">Blue</div>
  <div class="green">Green</div>
  <div class="blue">Blue</div>
  <div class="green">Green</div>
  <div class="blue">Blue</div>
  <div class="green">Green</div>