Responsive Flexbox Layout Control | Generated by AI

Home 2025.11

The correct answer is A. flex-direction

To make a flex container switch from a row layout on large screens to a column layout on small screens, you change the flex-direction property inside a media query.

Example:

.container {
  display: flex;
  flex-direction: row; /* default on large screens */
}

@media (max-width: 768px) {
  .container {
    flex-direction: column; /* switches to column on small screens */
  }
}

Explanation of why the others are wrong:

So even though you need a media query (C) to trigger the change, the property that actually arranges items in a row or column is flex-direction (A).

Correct answer: A


Back

x-ai/grok-4.1-fast

Donate