Flex Direction
Part of the Fundamentals section of Coddy's Tailwind CSS journey. Lesson 21 of 55.
In a flex container, flex-col stacks direct children vertically. The default flex-row follows the inline direction, which is left to right in this English document. Direction selects the main axis.
<div class="flex flex-col">Museum sample</div>Reversed directions change visual placement without changing the HTML reading order. Keep meaningful source order for keyboard and assistive technology users; use ordinary rows or columns for most interfaces.
Challenge
MediumStack the three itinerary stops vertically with a 28-pixel gap between stops. Use the specified gap value for both row and column gaps.
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>Arrive</span><span>Explore</span><span>Depart</span></div>
</body></html>
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Fundamentals
1Meet Tailwind
A Styled First RunChoosing UtilitiesCombining UtilitiesThe Local StylesheetRecap: Meet Tailwind