Menu
CoddyTech

Breakpoint Prefixes

Part of the Fundamentals section of Coddy's Tailwind CSS journey. Lesson 36 of 55.

A panel with px-2 md:px-4 has 8-pixel horizontal padding below the default md breakpoint and 16 pixels from md upward. In the default theme md is 48rem, normally 768 pixels. Unprefixed utilities form the base at every width.

<div class="px-2 md:px-4">Museum sample</div>

Responsive prefixes are minimum-width conditions, not device names. The md rule remains active on wider screens until another applicable rule changes the same property. Test both sides of the breakpoint after pressing Run preview. The default sm: condition starts at 40rem, normally 640 pixels, and lg: starts at 64rem, normally 1024 pixels.

challenge icon

Challenge

Medium

Give the festival panel 24-pixel horizontal padding below 768 pixels and 40 pixels at 768 pixels and above.

Keep the supplied content and element IDs. Edit the HTML utility classes or the requested CSS. Click Run preview to refresh the preview after edits, then use Check/Run code to grade your work.

Try it yourself

<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Practice studio</title><link rel="stylesheet" href="./styles.css"></head><body>
<div id="target" class="">Festival guide</div>
</body></html>
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Fundamentals