Challenge - 5 Problems
Flexbox Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
What does
flex class do in Tailwind CSS?In Tailwind CSS, what is the effect of adding the
flex class to a container element?Attempts:
2 left
💡 Hint
Think about how flexbox layouts start in CSS.
✗ Incorrect
The
flex class in Tailwind sets display: flex; on the element, activating flexbox layout. This allows child elements to be arranged in flexible rows or columns.📝 Syntax
intermediate1:30remaining
Which Tailwind class activates flexbox on a container?
You want to make a
<div> a flex container using Tailwind CSS. Which class should you add?Tailwind
<div class="???"> <p>Item 1</p> <p>Item 2</p> </div>
Attempts:
2 left
💡 Hint
The class name matches the CSS display property value.
✗ Incorrect
The
flex class sets display: flex; on the element, making it a flex container.❓ rendering
advanced2:30remaining
What is the visual result of adding
flex to a container with multiple children?Given this HTML and Tailwind CSS, what will you see in the browser?
Tailwind
<div class="flex border border-gray-400 p-4"> <div class="bg-blue-500 text-white p-2">Box 1</div> <div class="bg-green-500 text-white p-2">Box 2</div> <div class="bg-red-500 text-white p-2">Box 3</div> </div>
Attempts:
2 left
💡 Hint
Flexbox default direction is row.
✗ Incorrect
The
flex class makes the container a flexbox with default row direction, so child boxes appear side by side horizontally.❓ selector
advanced2:00remaining
Which Tailwind class combination makes a flex container with vertical stacking?
You want a flex container that stacks its children vertically. Which class combination achieves this?
Attempts:
2 left
💡 Hint
Flex direction controls stacking direction.
✗ Incorrect
The
flex class activates flexbox, and flex-col sets the flex direction to column, stacking children vertically.❓ accessibility
expert3:00remaining
How to ensure keyboard users can navigate flex container items properly?
You have a flex container with interactive child elements. What is the best practice to ensure keyboard accessibility?
Attempts:
2 left
💡 Hint
Think about how keyboard users interact with page elements.
✗ Incorrect
For accessibility, interactive elements inside flex containers should be focusable and use semantic HTML so keyboard users can navigate them easily.