Questions
2 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?
02 / 33

What is the syntax for setting a breakpoint using a media query?

Difficulty: 3/10
media queries, breakpoints, responsive design

Syntax for Setting a Breakpoint in CSS

In CSS, breakpoints are created using media queries. A media query checks the width (or other features) of the viewport and applies specific CSS rules when conditions are met. The most common breakpoints use the min-width or max-width properties.

Common Syntax Patterns
  1. 1

    Use @media (max-width: value) to apply styles for smaller screens.

  2. 2

    Use @media (min-width: value) to apply styles for larger screens.

  3. 3

    Combine multiple conditions using logical operators such as and.

Example: CSS Media Query Syntax

Scenario Questions

0-2 years experience

  1. 1We need a mobile‑first layout that switches to a two‑column grid at 768px. How would you write the CSS breakpoint?
  2. 2If you add a media query with max-width: 600px but the styles aren't applying, what could be wrong in the syntax?
  3. 3Show me the exact line of CSS you’d use to change the font size when the viewport is at least 1024px.

2-5 years experience

  1. 1You added a breakpoint at 1024px, but on some devices the layout still looks like the mobile version. Walk me through how you'd debug the media query syntax.
  2. 2When refactoring a component library, you need to replace hard‑coded pixel breakpoints with a design token. How would you adjust the media query syntax to use a CSS variable?
  3. 3Explain why you might choose min-width versus max-width in your breakpoint definitions, and how that affects the order of your media queries.

5-8 years experience

  1. 1Our design system defines breakpoints in em units for accessibility. How would you implement those breakpoints in CSS, and what are the trade‑offs compared to using px?
  2. 2We have a page with dozens of components each declaring their own media queries, leading to duplicated CSS. How would you restructure the breakpoint syntax to improve maintainability and reduce CSS size?
  3. 3During a performance audit, you notice that many media queries are being evaluated on every resize. What strategies can you employ at the breakpoint syntax level to mitigate this?

8+ years experience

  1. 1Our company is migrating a legacy codebase that uses inline style tags with hard‑coded pixel breakpoints to a centralized design system using CSS custom properties. Describe the steps and considerations for rewriting the breakpoint syntax across multiple repositories.
  2. 2When planning a cross‑team UI framework, how would you standardize breakpoint syntax to accommodate both web and native platforms, ensuring consistency while allowing platform‑specific overrides?
  3. 3What governance process would you put in place to evolve breakpoint definitions over time without breaking existing pages?

Follow-up Questions

  • How would you verify that the breakpoint is firing as expected?
  • What edge cases might cause a media query to be ignored?
  • How would you document this breakpoint for other developers?
Share

Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.