0
0
CSSmarkup~20 mins

Flex direction in CSS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Flex Direction Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:00remaining
Understanding flex-direction property
What is the default value of the flex-direction property in a flex container?
Acolumn-reverse
Bcolumn
Crow-reverse
Drow
Attempts:
2 left
💡 Hint
Think about how items are laid out horizontally by default.
📝 Syntax
intermediate
1:30remaining
CSS syntax for flex-direction
Which of the following CSS snippets correctly sets the flex container to arrange items vertically from top to bottom?
CSS
div.container {
  display: flex;
  /* flex-direction here */
}
Aflex-direction: row-reverse;
Bflex-direction: column;
Cflex-direction: column-reverse;
Dflex-direction: vertical;
Attempts:
2 left
💡 Hint
The property value should mean vertical stacking from top to bottom.
rendering
advanced
2:00remaining
Visual output of flex-direction: row-reverse
Given the following HTML and CSS, what will be the order of the items displayed in the browser?
CSS
<style>
.container {
  display: flex;
  flex-direction: row-reverse;
  gap: 1rem;
}
</style>
<div class="container">
  <div>Item 1</div>
  <div>Item 2</div>
  <div>Item 3</div>
</div>
AItem 3, Item 2, Item 1 (left to right)
BItem 1, Item 2, Item 3 (left to right)
CItem 1, Item 3, Item 2 (left to right)
DItem 2, Item 1, Item 3 (left to right)
Attempts:
2 left
💡 Hint
row-reverse reverses the horizontal order of items.
selector
advanced
1:30remaining
Selecting flex container for vertical layout
Which CSS selector and property combination correctly targets a flex container with class menu and sets its items vertically from bottom to top?
A.menu { display: flex; flex-direction: column; }
B#menu { display: flex; flex-direction: row-reverse; }
C.menu { display: flex; flex-direction: column-reverse; }
D.menu { display: block; flex-direction: column-reverse; }
Attempts:
2 left
💡 Hint
Look for the correct selector and the property value that reverses vertical order.
accessibility
expert
2:30remaining
Accessibility impact of flex-direction changes
When using flex-direction: row-reverse; on a navigation menu, what accessibility consideration should you keep in mind?
AScreen readers may read the menu items in the original HTML order, not the visual reversed order.
BKeyboard navigation order automatically reverses to match the visual order.
CColor contrast is affected by flex-direction changes.
DFlex-direction changes disable ARIA roles on the container.
Attempts:
2 left
💡 Hint
Think about how assistive technologies read content compared to visual layout.