0
0
Tailwindmarkup~20 mins

Flex container activation in Tailwind - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Flexbox Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2: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?
AIt sets the container's display property to <code>flex</code>, enabling flexbox layout.
BIt adds margin and padding to the container for spacing.
CIt changes the container's position to <code>absolute</code>.
DIt applies a grid layout to the container.
Attempts:
2 left
💡 Hint
Think about how flexbox layouts start in CSS.
📝 Syntax
intermediate
1: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>
Agrid
Bflex
Cblock
Dinline
Attempts:
2 left
💡 Hint
The class name matches the CSS display property value.
rendering
advanced
2: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>
AOnly one colored box visible because others are hidden.
BThree colored boxes stacked vertically inside a bordered container.
CThree colored boxes overlapping each other inside a bordered container.
DThree colored boxes arranged side by side in a row inside a bordered container.
Attempts:
2 left
💡 Hint
Flexbox default direction is row.
selector
advanced
2: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?
Ablock flex-col
Bflex flex-row
Cflex flex-col
Dgrid grid-cols-1
Attempts:
2 left
💡 Hint
Flex direction controls stacking direction.
accessibility
expert
3: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?
AEnsure each child element is focusable with <code>tabindex</code> or native focus, and use semantic HTML elements.
BAdd <code>aria-hidden="true"</code> to all child elements to hide them from screen readers.
CUse only <code>div</code> elements without any focus or ARIA attributes.
DDisable keyboard navigation by setting <code>tabindex="-1"</code> on all children.
Attempts:
2 left
💡 Hint
Think about how keyboard users interact with page elements.