# How to align center vertically using Tailwind

> Learn how to center content vertically and horizontally with Tailwind using the flex, items-center, and justify-center classes on the container element.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2021-05-06 | Topics: [CSS](https://flaviocopes.com/tags/css/) | Canonical: https://flaviocopes.com/how-to-align-center-vertically-tailwind/

I always tend to forget how to align center vertically using [Flexbox](https://flaviocopes.com/flexbox/).

You need a container with those CSS instructions:

```css
display: flex;
align-items: center;
justify-content: center;
```

In Tailwind, this translates to the classes `flex items-center justify-center`.

Example:

```html
<div class='flex items-center justify-center'>
  <button>Add</button>
</div>
```
