Loading Depth Study
Preparing your workspace
Tailwind uses responsive prefixes to apply different utilities at different viewport sizes.
Responsive design means the same interface should remain useful across different screen sizes. Tailwind uses a mobile-first approach. A utility without a prefix applies to the base layout, while prefixes such as sm, md, lg, xl, and 2xl apply styles at larger breakpoints. This allows you to start with a mobile-friendly design and progressively enhance it for larger screens. Responsive utilities can change layout, spacing, typography, visibility, width, and many other properties.
A course grid can show one card per row on mobile, two on tablets, and three on desktop.
<section class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3"> <div class="rounded-xl border p-5">Course 1</div> <div class="rounded-xl border p-5">Course 2</div> <div class="rounded-xl border p-5">Course 3</div> </section>
The cards use one column by default, two columns on small screens and larger, and three columns on large screens.