Learn Tailwind by translating CSS you understand into utility classes. If items-center appears to do nothing, knowing the container’s layout and available space will help more than memorizing another class name.
Start with a small CSS vocabulary
Work through the box model, flex and grid, and responsive design paths. Explain the difference between item alignment and track alignment before trying their utilities.
Choose one version and setup
This site’s compiled examples use Tailwind 3.3.2 and embed their styles for independent copying. Use the setup guide for that version or the linked version-4 instructions. Configuration and theme customization differ between major versions.
Practice a translation
Tailwind CSS 3.3.2; the CSS tab includes the compiled styles.
HTML
<div class="flex flex-wrap items-center gap-4 p-4 border">
<span class="font-bold">Topics</span><span>HTML</span><span>CSS</span>
</div>
CSS
*,
::before,
::after {
box-sizing: border-box;
border: 0 solid #e5e7eb;
}
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
margin: 0;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-size: inherit;
font-weight: inherit;
}
button,
input,
select,
textarea {
font: inherit;
color: inherit;
}
button {
background: none;
}
img,
svg,
video {
display: block;
max-width: 100%;
}
img,
video {
height: auto;
}
a {
color: inherit;
text-decoration: inherit;
}
ol,
ul,
menu {
list-style: none;
margin: 0;
padding: 0;
}
.flex {
display: flex;
}
.flex-wrap {
flex-wrap: wrap;
}
.items-center {
align-items: center;
}
.gap-4 {
gap: 1rem;
}
.border {
border-width: 1px;
}
.p-4 {
padding: 1rem;
}
.font-bold {
font-weight: 700;
}
Edit HTML or CSS to update the preview as you type. Copy code snippet copies the selected tab. Preview spacing and font defaults are not included.
Inspect the copied CSS for display: flex, flex-wrap, align-items and gap. Change items-center to items-start in a project with differently sized children. Predict the result, rebuild, and compare it with your prediction.
Build behavior as well as appearance
Try a button, form, and dialog. Check keyboard behavior and validation. Tailwind core is a utility framework; it does not automatically provide complete accessible components or their JavaScript. Component libraries and paid templates are separate choices.
Customize after you understand the defaults
Use the documentation for your version. This site changes some spacing keys, so its p-10 does not match standard Tailwind 3. Look at generated CSS when a utility surprises you. Keep a few reusable patterns, but avoid turning every small layout into a large abstraction before you know what is repeated.
Sources
Reference 1 Reference 2 provide the technical details and current compatibility information.