Questions
8 of 33
1What is a breakpoint in CSS? Why are breakpoints used in responsive web design?
2What is the syntax for setting a breakpoint using a media query?
3What is the syntax for setting a breakpoint using a media query?
4What units are typically used for defining breakpoints (e.g., px, em, rem)?
5What happens if no breakpoints are defined in a responsive layout?
6How do breakpoints help in mobile-first design?
7How does CSS decide which breakpoint to apply when multiple match?
8What’s the difference between min-width and max-width in media queries?
9How can you create a layout that adjusts between two breakpoints?
10What is the difference between device-based breakpoints and content-based breakpoints?
11What is the role of the viewport meta tag in responsive design?
12How do breakpoints help in mobile-first design?
13How does CSS decide which breakpoint to apply when multiple match?
14What’s the difference between min-width and max-width in media queries?
15What is the difference between device-based breakpoints and content-based breakpoints?
16What is the role of the viewport meta tag in responsive design?
17What is the difference between using em and px in defining breakpoints?
18How do you handle overlapping or conflicting breakpoint rules?
19Can breakpoints be combined with CSS Grid or Flexbox?
20How do CSS container queries differ from traditional breakpoints?
21How can you implement responsive typography using breakpoints?
22How can you use logical operators (and, not, only) in media queries?
23How does pixel density (device-pixel-ratio) affect breakpoints?
24What is the difference between min-device-width and min-width?
25How do you use breakpoints in frameworks like Bootstrap or Tailwind CSS?
26How would you write a media query for screens smaller than 768px?
27How would you create a responsive navigation bar using breakpoints?
28How would you handle images that need to resize at specific breakpoints? How can you make font sizes scale smoothly between two breakpoints?
29How would you debug a layout that looks broken at a specific breakpoint?
30How would you optimize breakpoints for tablets vs. phones?
31How can you prevent layout jumps between breakpoints?
32How do you use CSS custom properties (variables) with breakpoints?
33How do breakpoints differ between desktop, tablet, and mobile-first strategies?
08 / 33

What’s the difference between min-width and max-width in media queries?

Difference Between min-width and max-width in Media Queries

The min-width and max-width properties in CSS media queries define the range of viewport sizes where specific styles should apply. They are essential for creating responsive layouts that adapt to different devices.

Key Differences
  1. 1

    min-width applies styles when the viewport is equal to or wider than the specified width — typically used in mobile-first design.

  2. 2

    max-width applies styles when the viewport is equal to or narrower than the specified width — typically used in desktop-first design.

  3. 3

    You can combine them to target specific ranges, such as tablets or mid-sized devices.

Example: Using min-width and max-width
Difficulty: 4/10
Topics: responsive design, media queries, layout

Scenario Questions

0-2 years experience
  1. 1

    How would you write a media query that switches a two‑column layout on only when the viewport is at least 600 px wide?

  2. 2

    If you have a container with max-width: 800px and a min-width: 500px media query, what layout will you see when the viewport is 750 px?

2-5 years experience
  1. 1

    A component should collapse to a single column below 480 px, but on some phones it stays in two columns. Walk me through how you’d debug the media queries.

  2. 2

    Why might adding a max‑width breakpoint after a mobile‑first min‑width rule cause unexpected styling on tablet screens?

5-8 years experience
  1. 1

    We need a fluid grid that works from 320 px up to 1920 px while keeping CSS size low. How would you organize min‑width and max‑width queries to avoid overlap and reduce reflows?

  2. 2

    A third‑party widget injects fixed‑width CSS that breaks our layout. How could you use min‑width / max‑width media queries to safely contain it without affecting the rest of the page?

8+ years experience
  1. 1

    Our legacy codebase uses many max‑width (desktop‑first) queries. How would you plan a migration to a mobile‑first, min‑width‑only approach across several teams while keeping the UI stable?

  2. 2

    Discuss the long‑term maintenance trade‑offs of relying heavily on max‑width breakpoints versus a fluid, min‑width‑only system in a large design system.

Follow-up Questions

  • Can you show the exact CSS syntax for a min‑width and a max‑width media query?
  • How does the order of these queries in the stylesheet affect which rules win?
  • What impact do these breakpoints have on performance or reflow?