Open this example in the interactive library
Source code
<style>
.demo {
display: grid;
place-items: center;
min-height: 6rem;
}
</style>
<div class="demo"><span class="tile">Centred</span></div>
Centre grid items on both axes with native CSS. The preview includes a small shared demo stylesheet.
Open this example in the interactive library
<style>
.demo {
display: grid;
place-items: center;
min-height: 6rem;
}
</style>
<div class="demo"><span class="tile">Centred</span></div>