HTML & CSS · Junior · Question 25 of 75
How are media queries usually written with a mobile-first approach?
- 1With
max-width: base styles for desktop, then simplifications for mobile - 2With
orientation: portraitfor all cases - ✓Correct answer: With
min-width: base styles for mobile, additions for larger screens
Explanation
In mobile-first, the base CSS targets small screens, and @media (min-width: ...) adds styles as the screen grows. Mobile devices get the fewest overrides and styles are easier to build up. Using max-width is desktop-first. Tailwind breakpoints follow the same principle.