What's new in CSS?

align-content in Block Layouts

align-content in Block Layouts

The align-content property has always worked in conjunction with Flexbox or Grid, but we can now use it on standard block level elements, too!

Vertical centering used to be the quintessential pain point in CSS - now it couldn't be simpler!

Standard CSS

div {
  align-content: center;
}

Tailwind

<div class="content-center">
    <p>I'm vertically centered!</p>
</div>

Normal divs with display: block

align-content: start;

align-content: center;

align-content: end;

align-content in Block Layouts

Menu