<div class="wrapper">
  <div class="stack medium"> 
    <div class="item">element</div>
    <div class="item">element</div>
    <div class="item">element</div>
  </div>
</div>
/* Stack implementation */
:root {
  --space-medium: 1rem;
}

.stack.medium > * {
  margin-bottom: var(--space-medium);
}


/* visuals (feel free to ignore) */
.item {
  background: #fef7f7;
  border: 1px solid #e8dce0;
  width: 100%;
  padding: 0.5rem;
  color: #696161;
  font-family: sans-serif;
  text-align: center;
  box-sizing: border-box;
}
.wrapper {
  background-color: #f2a4ff;
  max-width: 300px;
}



Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.