Challenge - 5 Problems
Flex Direction Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ rendering
intermediate2:00remaining
What is the visual order of items with
flex-row-reverse?Given this HTML and Tailwind CSS, what is the order of the boxes from left to right as seen in the browser?
<div class="flex flex-row-reverse gap-4"> <div class="w-12 h-12 bg-red-500">1</div> <div class="w-12 h-12 bg-green-500">2</div> <div class="w-12 h-12 bg-blue-500">3</div> </div>
Tailwind
<div class="flex flex-row-reverse gap-4"> <div class="w-12 h-12 bg-red-500">1</div> <div class="w-12 h-12 bg-green-500">2</div> <div class="w-12 h-12 bg-blue-500">3</div> </div>
Attempts:
2 left
💡 Hint
Remember that
flex-row-reverse reverses the horizontal order of flex items.✗ Incorrect
The
flex-row-reverse class makes the flex container arrange items horizontally but in reverse order. So the last item in the HTML (3) appears first on the left, then 2, then 1.❓ selector
intermediate1:30remaining
Which Tailwind class sets vertical stacking of flex items?
You want your flex container to stack items vertically from top to bottom. Which Tailwind CSS class should you use?
Attempts:
2 left
💡 Hint
Think about the direction of the main axis in flexbox.
✗ Incorrect
The
flex-col class sets the flex direction to column, stacking items vertically from top to bottom.🧠 Conceptual
advanced2:00remaining
What happens if you combine
flex-col and flex-row on the same element?Consider this HTML:
What is the effective flex direction applied by Tailwind CSS?
<div class="flex flex-col flex-row">...</div>
What is the effective flex direction applied by Tailwind CSS?
Attempts:
2 left
💡 Hint
Tailwind applies classes in the order they appear in the class attribute, with later classes overriding earlier ones.
✗ Incorrect
When multiple conflicting classes are applied, the last one wins. Here,
flex-row overrides flex-col, so the flex direction is row.❓ layout
advanced2:00remaining
How does
flex-col-reverse affect vertical stacking?Given this HTML:
What is the vertical order of the items from top to bottom as seen in the browser?
<div class="flex flex-col-reverse gap-2"> <div>A</div> <div>B</div> <div>C</div> </div>
What is the vertical order of the items from top to bottom as seen in the browser?
Tailwind
<div class="flex flex-col-reverse gap-2">
<div>A</div>
<div>B</div>
<div>C</div>
</div>Attempts:
2 left
💡 Hint
The
-reverse suffix reverses the normal stacking order.✗ Incorrect
The
flex-col-reverse class stacks items vertically but in reverse order, so the last item (C) appears at the top, then B, then A at the bottom.❓ accessibility
expert2:30remaining
Which flex direction is best for screen readers to read content in natural order?
You have a navigation menu with items arranged using flexbox. For best accessibility and natural reading order by screen readers, which flex direction should you use?
Attempts:
2 left
💡 Hint
Screen readers read content in the order it appears in the HTML source.
✗ Incorrect
Using
flex-row keeps the visual order matching the HTML source order, which helps screen readers read content naturally. Reverse directions can confuse reading order.