Q
In a flex container with flex-direction: row, what do justify-content and align-items control?
-
A
justify-content controls the vertical alignment
-
B
Both control the vertical alignment
-
C
justify-content controls the horizontal (main axis) alignment; align-items controls the vertical (cross axis) alignment
-
D
Both control the horizontal alignment
Correct Answer:
C. justify-content controls the horizontal (main axis) alignment; align-items controls the vertical (cross axis) alignment
Explanation:
With flex-direction: column, the axes swap.
ALSO KNOW (related points):
• What are SASS and LESS? → CSS preprocessors that add variables, nesting, and mixins, and compile to plain CSS