Menu
CoddyTech

Responsive Direction

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

An author bio with flex flex-col md:flex-row stacks its portrait and text on narrow screens, then places them in a row at md and wider. The content stays in the same source order.

<div class="flex flex-col md:flex-row">Museum sample</div>

Change the layout property that needs to adapt instead of duplicating content for separate devices. Keep a base gap so both the stacked and horizontal layouts have clear separation. The default lg: breakpoint begins at 64rem, normally 1024 pixels.

challenge icon

Challenge

Medium

Stack the booking details below 1024 pixels, then use a row from 1024 pixels upward. Keep 28 pixels of gap in both layouts.

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="flex"><span>Time: 10:00</span><span>Place: Studio</span></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