sodcalculator

10 Tech How-To

CSS Breakpoints: How to Choose Them

Guide 10-47807 · Updated · Step by step

CSS breakpoints are the viewport widths where your layout changes to adapt to different screen sizes. You choose them by looking at where your design starts to look broken, not by targeting specific devices. This article explains the common breakpoint values, how to pick your own, and how to avoid the most frequent mistakes.

How CSS Breakpoints Work

You write CSS inside media queries, which apply only when the viewport (the browser window or device screen) meets the condition. The most common syntax is @media (min-width: 768px) { ... }, which means the rules inside apply when the viewport is at least 768px wide. You can also use max-width to apply styles below a width, but mixing both can get confusing. Most modern sites use a mobile-first approach: write the base styles for small screens, then use min-width queries to add enhancements as the screen grows. This way, older phones that don’t support media queries still get the mobile layout.

Breakpoints are not about specific devices. An iPhone in landscape might be 667px wide, while an Android phone could be 740px. Device names change every year; content stays. The goal is to find the widths where your layout starts to look cramped, overflow, or become hard to read, and set a breakpoint there.

How to Choose Your Own Breakpoints

Instead of copying a framework, follow these steps:

  1. Open your site in a desktop browser and resize the window slowly from wide to narrow.
  2. Note the exact pixel width where the layout breaks—text overflows, images overlap, or whitespace looks wrong.
  3. Write down those widths. They are your natural breakpoints.
  4. Test on real devices: a phone (360px), a tablet (768px), a laptop (1366px), and a large desktop (1920px).
  5. Adjust your breakpoints to the nearest common value (e.g., 360, 768, 1024, 1280) to keep them memorable.

You do not need a breakpoint for every device. A typical site might only need two or three. For example, a simple blog could have:

  • Base (mobile): single column
  • ≥768px: two columns for sidebar
  • ≥1200px: wider max-width and larger fonts

That’s it. Every extra breakpoint adds complexity and testing time.

Common Breakpoint Values and Their Origins

The 576/768/992/1200 set comes from Bootstrap 4, which adjusted earlier values (768, 992, 1200) to better match common device widths. Tailwind CSS uses 640, 768, 1024, 1280, 1536. Foundation uses 640, 1024, 1440. These are all arbitrary. The reason 768px appears everywhere is that the iPad in portrait was 768px wide, and tablets became a key target. But tablets now come in many sizes, so relying on that number is outdated.

Another common set is 480px (large phones), 768px (tablets), 1024px (small laptops), 1280px (desktop). This is fine if it matches your content. The key is to test, not to memorize.

Common Mistakes and Misconceptions

Mistake 1: Targeting devices. Writing @media (max-width: 767px) to target phones will fail when a new phone with a 768px viewport appears. Always use content-based breakpoints.

Mistake 2: Using too many breakpoints. Each breakpoint doubles the number of layouts you must test. Start with one or two and add only when needed.

Mistake 3: Ignoring the viewport meta tag. Without <meta name="viewport" content="width=device-width, initial-scale=1"> in your HTML, media queries won’t work on mobile browsers; they’ll render a 980px desktop view and zoom out.

Mistake 4: Using px for everything. While breakpoints are usually in px, consider using em if you want breakpoints to respond to the user’s font-size settings. 1em equals the root font size (usually 16px), so 48em is 768px.

Misconception: “Mobile first” means you can’t use max-width. Mobile-first simply means base styles are for mobile, and you use min-width to add desktop styles. You can still use max-width for specific overrides, but it’s cleaner to stick to one direction.

Comparing Breakpoint Strategies

There are three main approaches:

  • Framework breakpoints: Use Bootstrap or Tailwind defaults. Pros: fast, consistent, well-tested. Cons: may not match your content, adds unused CSS.
  • Content-based breakpoints: Choose widths where your design breaks. Pros: perfect fit, minimal CSS. Cons: requires manual testing, may be less predictable across devices.
  • Hybrid: Start with a framework, then adjust to your content. Pros: best of both. Cons: requires understanding of both.

For most projects, the hybrid approach is recommended. You get a solid starting point and then refine.

Costs and Performance

Breakpoints themselves cost nothing in performance—media queries are just CSS. The cost is in development time and maintenance. More breakpoints mean more places to test and more chances for bugs. A common performance pitfall is loading large desktop images on mobile; use srcset to serve appropriately sized images, and hide elements with CSS only if they are truly unnecessary (but remember they still download).

Alternatives to CSS Breakpoints

CSS Grid and Flexbox can handle many layout changes without media queries. For example, grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) automatically wraps columns based on available space, eliminating the need for a breakpoint. Container queries (now supported in modern browsers) let you style elements based on their container’s width, not the viewport. This is powerful for components that live in different contexts. However, breakpoints are still the simplest and most widely supported method for whole-page layout changes.

Frequently Asked Questions

What is the standard CSS breakpoint for mobile?

There is no official standard. Common mobile breakpoints are 576px (Bootstrap) and 640px (Tailwind). The iPhone 12 is 390px wide, so anything below 576px is typically mobile. Test your site at 360px (small Android) and 390px (iPhone) to be safe.

Should I use min-width or max-width?

Use min-width for mobile-first design: write base styles for mobile, then add min-width queries for larger screens. This is easier to maintain and ensures mobile users get the simplest CSS. Use max-width only when you need to override a desktop style for smaller screens, but try to avoid mixing.

How many breakpoints should I have?

As few as possible. A simple site might need one (e.g., 768px) to switch from single-column to two-column. A complex dashboard might need three or four. Each breakpoint adds testing overhead, so only add one when your design actually breaks.

Do breakpoints affect SEO?

Not directly. Google’s mobile-first indexing means your mobile layout matters for ranking, but breakpoints are just CSS. What matters is that your site is usable on mobile. A responsive site with well-chosen breakpoints will rank better than a non-responsive one.

Can I use breakpoints for print or other media?

Yes, media queries can target media types like print, screen, and speech. For print, you might hide navigation and adjust margins. But breakpoints specifically refer to width/height conditions, which are mainly for screens.

What is the difference between breakpoints and container queries?

Breakpoints respond to the viewport width; container queries respond to the width of a specific parent element. Container queries are more modular because a component can adapt to wherever it is placed. They are now supported in all modern browsers, but breakpoints remain simpler for page-level layouts.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →