Dev Helpers
← Back

Put an earlier item on top

Put an earlier item on top with native CSS. The preview includes a small shared demo stylesheet.

Open this example in the interactive library

Source code

<style>
  .demo {
    display: grid;
  }
  .demo > * {
    grid-area: 1 / 1;
    width: fit-content;
  }
  .demo > :first-child {
    z-index: 2;
    margin: 0.5rem;
  }
</style>
<div class="demo">
  <span class="tile">One</span><span class="tile">Two</span
  ><span class="tile">Three</span>
</div>