Tailwind CSS
Beginner
1 min read
Core Layout and Display Utilities
Example
<!-- Display utilities -->
<div class="block">Block element</div>
<span class="inline-block">Inline block</span>
<div class="hidden">Not rendered (display: none)</div>
<div class="invisible">Hidden but space preserved</div>
<!-- Positioning -->
<div class="relative w-64 h-32 bg-gray-100">
<div class="absolute top-2 right-2 bg-red-500 text-white text-xs px-2 py-1 rounded">
Badge
</div>
</div>
<!-- Fixed header -->
<header class="fixed top-0 left-0 right-0 z-50 bg-white shadow-md h-16">
Fixed navigation bar
</header>
<!-- Sticky sidebar -->
<aside class="sticky top-20 self-start">
Stays visible when scrolling
</aside>
<!-- Width & height combinations -->
<div class="w-full max-w-3xl mx-auto"> <!-- centered, capped at 48rem -->
<img class="w-full h-48 object-cover rounded-lg" src="hero.jpg" alt="" />
</div>
<!-- Overflow control -->
<div class="overflow-hidden h-24">
Long content that gets clipped at 6rem height
</div>
<div class="overflow-x-auto">
<table class="min-w-max">Wide table that scrolls horizontally</table>
</div>
Related Resources
Tailwind CSS Reference
Complete tag & property list
Tailwind CSS How-To Guides
Step-by-step practical guides
Tailwind CSS Exercises
Practice what you've learned
More in Tailwind CSS