In modern web development, more than 60% of all web traffic originates from mobile smartphones. Tailwind CSS adopts an uncompromising mobile-first design architecture: un-prefixed utilities apply to mobile devices, while prefixed modifiers (sm:, md:, lg:, xl:, 2xl:) apply at specified minimum viewport widths (min-width media queries).
| Prefix | Minimum Width | CSS Media Query Target | Typical Device |
|---|---|---|---|
| (None) | 0px | Default mobile styles | All smartphones (portrait) |
sm: | 640px | @media (min-width: 640px) | Large phones, small tablets |
md: | 768px | @media (min-width: 768px) | iPads, medium tablets |
lg: | 1024px | @media (min-width: 1024px) | Laptops, desktop monitors |
xl: | 1280px | @media (min-width: 1280px) | High-res desktop screens |
2xl: | 1536px | @media (min-width: 1536px) | Ultra-wide monitors, 4K displays |
sm: to target mobile phones!
Unprefixed classes target mobile. Breakpoint prefixes target that screen size and everything larger.lg: breakpoint in default Tailwind CSS?sm:text-sm md:text-base if a developer wants text-sm on mobile smartphones under 640px?tablet: 800px) in Tailwind CSS?Continue learning with hands-on practice, examples, and exercises in the upcoming topic.
Test your understanding of this lesson with 5 questions. Each question has one correct answer.
Practice in live mentor-led sessions with real projects, mock tests, and verifiable certification at MSK Institute.