World’s largest virtual agentic engineering & quality conference
Learn how common CSS breakpoints and responsive breakpoints work in media queries so your layouts adapt cleanly across mobile, tablet, and desktop screens.
Ayush Thakur
Author

Himanshu Sheth
Reviewer
Last Updated on: August 8, 2026
CSS Media queries play a crucial role in implementing responsive behavior in web applications. By incorporating CSS Media queries into the styling, we can customize the appearance of various devices with varying screen sizes.
Media queries need common CSS breakpoints, also called responsive breakpoints, to work. A breakpoint is a screen-width value; when the width matches it, the media query applies its CSS.
TL;DR
Common CSS breakpoints are the screen-width values where a media query changes your layout. Which values you pick depends less on device charts than on where your own content breaks, so treat framework defaults as a starting point and add breakpoints only where the design needs them.
CSS media queries are style rules that apply CSS only when the viewport meets a condition, such as a width breakpoint, letting one page adapt its layout across phones, tablets, and desktops.
For example, compare two navigation styles, a horizontal bar and a responsive vertical layout:
As the screen narrows, a media query flips that horizontal bar into the vertical menu below:
The vertical menu is far easier to use on small screens, and the media query handles the switch automatically.
The syntax of media queries looks something like this:
@media only screen and (max-width: viewportSize (in pixels)) {
// applied CSS styling
}
// for mobile view
@media only screen and (max-width: 481px) {
// applied CSS styling
}
// for tablet view
@media only screen and (max-width: 769px) {
// applied CSS styling
}
// for laptop view
@media only screen and (max-width: 1026px) {
// applied CSS styling
}
Till now, we have been using pixel units in the media queries to define the screen size, but it is not mandatory. You can also use other measuring units, including em, rem, etc.
A breakpoint is the screen width where a media query starts to apply. There is no fixed rule for choosing one, but a few common values cover most devices, with larger screens using larger breakpoints.
CSS frameworks such as Bootstrap and Tailwind ship pre-defined breakpoints as keywords, so you skip defining them yourself. These keywords map to breakpoints as follows:
| Breakpoint | Keyword | Dimension |
|---|---|---|
| Small | sm | ≥576px |
| Medium | md | ≥768px |
| Large | lg | ≥992px |
| Extra large | xl | ≥1200px |
| Extra extra large | xxl | ≥1400px |
Beyond fixed values, CSS media queries offer other ways to define breakpoints.
The two approaches are:
Note: Test CSS Media Queries across thousands of real browser environments. Try TestMu AI Today!
When assigning responsive breakpoints, prioritize the content of the interface over predefined fixed values. Content-based breakpoints let the layout, not a device list, decide where each breakpoint goes.
With this method, you add a new breakpoint at every width where content shifts out of place and breaks the layout. These advanced CSS tricks and techniques make breakpoints much easier to place.
Take a paragraph that reads fine on desktop but overflows as the screen narrows. In my experience, resizing until the text breaks is the fastest way to find the exact width that needs a breakpoint:
To keep the reading experience intact, add a breakpoint wherever the text starts to overflow or misalign. The layout then stays comfortable to read at every width.
The same content-based approach works as the screen widens, not only as it narrows. The example below shows it in action:
Here the breakpoint triggers at 480px and above: wider screens show four columns in a row, while anything below 480px collapses to a single column.
This breakpoint targets the 480px to 768px range: within that band the grid shows two columns, and outside it, on narrower screens, it drops to a single column.
Here you group devices by screen resolution, pick one breakpoint per group, and style that breakpoint so it covers most devices in the group.
Target a specific device by its width, height, and pixel ratio (iPhone 14 Pro Max shown; swap the values per device):
/* ----------- iPhone 14 pro max ----------- */
/* 932 x 430 pixels*/
@media only screen
and (device-width: 430px)
and (device-height: 932px)
and (-webkit-device-pixel-ratio: 3) {
/* ----------- CSS Styling -----------
*/
}
You can also group devices by screen width and assign one breakpoint per group. The -webkit-device-pixel-ratio feature targets specific pixel ratios and is used by WebKit browsers like Safari.
/* For very small screen devices (500px and below) */
@media only screen and (max-width: 500px){
/* CSS Styling */
}
/* Small screen devices (600px and above) */
@media only screen and (min-width: 600px) {
/* CSS Styling */
}
/* Medium screen devices (700px and above) */
@media only screen and (min-width: 700px) {
/* CSS Styling */
}
/* Big screen devices (900px and above) */
@media only screen and (min-width: 900px) {
/* CSS Styling */
/* Extra big screen devices (1200px and above) */
@media only screen and (min-width: 1200px) {
/* CSS Styling */
}
Across the examples so far, breakpoints have used min-width, max-width, or both.
So which one should you use, and when? Two scenarios cover most cases:
Taking an example:
Here a container uses a four-column grid. Two max-width media queries adjust it: at 769 px or below it drops to two columns, and at 480 px or below to a single column.
Media queries can also combine min-width and max-width, so you can style based on both bounds of the screen at once.
This example combines min-width and max-width in one query: above 769px the grid keeps four columns, and below 480px it reduces to two.
Combine both to target a specific range, such as the tablet band.
The pixel is a static unit, unaffected by screen width or font size. That makes px predictable, but it also means px breakpoints add no responsiveness of their own.
Units like em and percentage scale with the parent font size or screen width, adding natural responsiveness and reducing how many media queries you need.
Note: Experience the full potential of your CSS-based web applications on real devices. Try TestMu AI Today!
Sass is a stylesheet language layered on CSS, adding nested rules, mixins, and variables while staying fully compatible with plain CSS. Files use the .sass or .scss extension.
Sass supports everything CSS does, including media query breakpoints and every CSS at-rule. That forward compatibility with at-rules is part of why teams adopt it.
Sass offers some different syntaxes to create CSS at-rule. These syntax are @< tag1 >< tag2 >, @< tag >{…}, or @< tag1 >< tag2 >{…}.
@image {
width: 30px;
src: url("#image_link");
}
@title {
font-family: "Sarif";
color: "red";
}
Placing a CSS rule inside an at-rule lets you apply conditional styling without changing the underlying selector.
Once Sass is installed, it compiles your rules: a source input.scss file is pre-processed and assembled into an output.css file the browser reads.
The @supports at-rule applies a block of CSS only if the browser supports a given property. If the condition is true, the styling applies; otherwise it is skipped.
Here is the syntax of the @support at-rule:
@supports (condition to be applied) {
// CSS Styles to be applied
}
Let's look at an example of it:
@supports (display: grid) {
.classname {
display: grid;
grid-template-rows: repeat(4, 1fr);
grid-template-columns: repeat(4, 1fr);
grid-gap: 3rem;
}
}
Here the condition is display: grid. Most modern browsers support CSS Grid, but older ones do not, and Apple's Safari only became fully compatible from Safari 10 onward.
The @media at-rule is the most common way to add responsiveness, letting you define different styling per screen width across devices.
It adapts the UI to the device by examining factors like width, height, orientation, and resolution.
It can also define separate styling for screen readers or printed documents, not just screens.
Syntax of @media is mentioned below:
@media only screen and (max-width: viewportSize (in pixels)) {
// applied CSS styling
}
For the example part of @media, you can take a look at some of the examples explained earlier in this blog.
The @keyframes at-rule defines CSS animations by describing how styles change over the course of the animation.
To define changing styles, you set a start and end state. Use the keyframe values 0% and 100%, where 0% is the animation's starting position and 100% its ending position.
Animation properties give you full control over how the animation looks. Note that inside @keyframes, the !important rule has no effect.
Here is the syntax of @keyframes at-rule:
@keyframes animation-name {keyframes-selector {css-styles;}}
Here's an example of @keyframes:
If we break it down this example, then we get:
In the from block, scale(1,1) starts the animation at the original height and width. The to block sets scale() width to 4.5x, so the element stretches to 4.5x its width.
Note: To apply this animation over an element, we need to use a couple of CSS animation properties, including animate-name, animation-timing-function, and animation-duration on the targeted element.
Every device has a different screen width, so setting a unique breakpoint for each one is impractical.
Therefore, to ease this task, some specific breakpoints are selected depending upon the webpage content that will work in most of the devices available in the market.
The common CSS breakpoints are:
Many teams reach for CSS frameworks for convenience, and those frameworks ship their own media query breakpoints.
Popular CSS frameworks ship these breakpoints:
Now, we will discuss how we can create a Responsive Navigation Menu with the backing of CSS Media queries and common CSS breakpoints that we have addressed thus far.
The navigation menu adapts to screen size. On laptops and desktops it renders as a horizontal bar; as the width shrinks, that bar transforms into a vertical menu.
The vertical menu will be hidden under a hamburger icon and will only come into view when the user clicks on the hamburger icon.
The markup uses three div tags for the hamburger icon lines, and a ul with li items for the menu links.
CSS styles the menu, and a max-width media query at 800 px adds the responsive behavior.
A small piece of JavaScript wires up the hamburger icon: clicking it toggles the vertical menu open and closed using the classList toggle method.
Here are some best practices for setting responsive breakpoints:
Once you add breakpoints, verify the result before shipping. An emulator and a real device can render the same media query differently, so test each breakpoint across actual screen widths.
You can check layouts quickly with a responsive test online, then confirm edge cases like notches and browser chrome on real hardware.
LT Browser by TestMu AI is a desktop app for building and debugging responsive layouts. It shows each breakpoint rendering on dozens of device viewports side by side, so you catch breaks before production.
Note: Preview your responsive breakpoints across 50+ device viewports with LT Browser by TestMu AI. Try TestMu AI Today!
Common CSS breakpoints make a layout respond to screen width, but the values that matter are the ones your content demands, not a fixed device chart. Start mobile-first, then add breakpoints where the design breaks.
Defining breakpoints is only half the job. A layout that looks right in one desktop window can still break on a real phone, so test each breakpoint on real browsers and devices before shipping.
Author
Ayush Thakur is a community contributor with 3+ years of experience in developer advocacy, technical writing, and community building. He specializes in creating content around modern web development, frontend technologies, and developer tooling, with hands-on experience using Next.js, GraphQL, and JavaScript ecosystems. Ayush has worked in Developer Relations and Advocacy roles across multiple tech organizations and actively contributes to developer communities as a community manager and technical content creator. He holds a Bachelor’s degree in Information Technology.
Reviewer
Himanshu Sheth is the Director of Marketing (Technical Content) at TestMu AI, with over 8 years of hands-on experience in Selenium, Cypress, and other test automation frameworks. He has authored more than 130 technical blogs for TestMu AI, covering software testing, automation strategy, and CI/CD. At TestMu AI, he leads the technical content efforts across blogs, YouTube, and social media, while closely collaborating with contributors to enhance content quality and product feedback loops. He has done his graduation with a B.E. in Computer Engineering from Mumbai University. Before TestMu AI, Himanshu led engineering teams in embedded software domains at companies like Samsung Research, Motorola, and NXP Semiconductors. He is a core member of DZone and has been a speaker at several unconferences focused on technical writing and software quality.
Did you find this page helpful?
More Related Blogs
TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance