Tailwind Flexbox Classes to CSS

Convert Tailwind flexbox utility classes like flex, items-center, justify-between to their CSS equivalents. See the exact CSS properties behind Tailwind's flex layout system.

Layout

Detailed Explanation

Tailwind Flexbox Utilities in CSS

Tailwind provides a comprehensive set of flexbox utility classes that map directly to CSS flexbox properties. Understanding these mappings is essential when debugging layouts or migrating away from Tailwind.

Core Flex Display

The flex class sets display: flex, while inline-flex sets display: inline-flex. These are the foundation of any flex layout.

/* flex */
display: flex;

/* inline-flex */
display: inline-flex;

Direction and Wrapping

Tailwind's direction classes map to the flex-direction property:

  • flex-rowflex-direction: row (default, horizontal)
  • flex-colflex-direction: column (vertical)
  • flex-row-reverseflex-direction: row-reverse
  • flex-col-reverseflex-direction: column-reverse

For wrapping, flex-wrap maps to flex-wrap: wrap and flex-nowrap maps to flex-wrap: nowrap.

Alignment

The most commonly used alignment classes are:

/* items-center */
align-items: center;

/* items-start */
align-items: flex-start;

/* justify-between */
justify-content: space-between;

/* justify-center */
justify-content: center;

Flex Shorthand

Tailwind's flex-1, flex-auto, flex-initial, and flex-none map to the CSS flex shorthand property, which combines flex-grow, flex-shrink, and flex-basis into a single declaration.

Use Case

Developers debugging a flex layout in DevTools who need to know the exact CSS properties behind Tailwind classes, or teams migrating a component library from Tailwind to vanilla CSS while preserving identical flex behavior.

Try It — Tailwind to CSS Converter

Open full tool