Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What does the CSS property flex-direction control?
It controls the direction in which flex items are placed inside a flex container. It can be row, column, row-reverse, or column-reverse.
Click to reveal answer
beginner
What is the default value of flex-direction?
The default value is row, which means flex items are laid out horizontally from left to right.
Click to reveal answer
beginner
How does flex-direction: column change the layout?
It stacks flex items vertically from top to bottom instead of horizontally.
Click to reveal answer
intermediate
What is the difference between row-reverse and column-reverse?
row-reverse lays out items horizontally but in reverse order (right to left). column-reverse stacks items vertically but from bottom to top.
Click to reveal answer
intermediate
Why is flex-direction useful in responsive design?
It lets you change the layout direction easily on different screen sizes, for example switching from row to column on small screens for better readability.
Click to reveal answer
What happens if you set flex-direction: column on a flex container?
AFlex items stack vertically from top to bottom
BFlex items stack horizontally from left to right
CFlex items disappear
DFlex items overlap each other
✗ Incorrect
Setting flex-direction: column stacks the flex items vertically in the container.
Which flex-direction value lays out items from right to left horizontally?
Arow
Brow-reverse
Ccolumn
Dcolumn-reverse
✗ Incorrect
row-reverse reverses the horizontal order, placing items from right to left.
What is the default flex-direction value if none is set?
Acolumn-reverse
Bcolumn
Crow-reverse
Drow
✗ Incorrect
The default is row, which lays out items horizontally left to right.
If you want to stack items vertically but in reverse order (bottom to top), which flex-direction do you use?
Acolumn-reverse
Bcolumn
Crow-reverse
Drow
✗ Incorrect
column-reverse stacks items vertically from bottom to top.
Why might you change flex-direction in a responsive design?
ATo change the color of items
BTo hide some items
CTo change the order and layout direction for better viewing on different screen sizes
DTo add animations
✗ Incorrect
Changing flex-direction helps rearrange items for better readability on small or large screens.
Explain what the CSS property flex-direction does and list its possible values.
Think about how items are arranged inside a flex container.
You got /3 concepts.
Describe a real-life scenario where changing flex-direction would improve a website's layout on different devices.
Imagine how a menu or list looks on a phone versus a desktop.
You got /3 concepts.
Practice
(1/5)
1. What does the CSS property flex-direction control in a flex container?
easy
A. The direction in which flex items are laid out (row or column)
B. The color of flex items
C. The size of the flex container
D. The font style of flex items
Solution
Step 1: Understand the role of flex-direction
The flex-direction property sets the main axis direction for flex items inside a flex container.
Step 2: Identify what flex-direction affects
It controls whether items are laid out in a row (horizontally) or column (vertically), and if the order is normal or reversed.
Final Answer:
The direction in which flex items are laid out (row or column) -> Option A
Quick Check:
flex-direction controls layout direction [OK]
Hint: Remember: flex-direction sets row or column layout [OK]
Common Mistakes:
Confusing flex-direction with color or size properties
Thinking flex-direction changes container size
Assuming flex-direction affects font styles
2. Which of the following is the correct syntax to set flex items in a column direction?
easy
A. display: flex; flex-direction: row-column;
B. display: flex; direction: column;
C. display: block; flex-direction: column;
D. display: flex; flex-direction: column;
Solution
Step 1: Check the container display property
Flexbox requires display: flex; on the container to work.
Step 2: Verify the flex-direction syntax
The correct property is flex-direction with values like row or column. The value column is valid.
Final Answer:
display: flex; flex-direction: column; -> Option D
Quick Check:
Use display flex + flex-direction column [OK]
Hint: Always use display:flex before flex-direction [OK]