MobileFirst Malaysia Logo MobileFirst Malaysia Contact Us
Contact Us
Web Design Guide

Media Queries and Breakpoints Strategy

Learn how to write effective media queries and choose the right breakpoints for tablets, phones, and desktop screens. Master responsive design from the ground up.

10 min read Intermediate February 2026
Laptop screen displaying CSS code for media queries and responsive design implementation

Why Breakpoints Matter

Your website needs to look good everywhere. Whether someone’s checking it on a 6-inch phone or a 27-inch monitor, the experience should be smooth and readable. That’s where breakpoints come in — they’re the specific screen sizes where your layout adapts and reorganizes.

Here’s the thing: there’s no one-size-fits-all approach. You don’t need to support every possible device width. Instead, you’ll focus on the major breakpoints that matter to your audience. Most modern designs use 3-5 carefully chosen breakpoints to handle mobile phones, tablets, and desktops.

Mobile-First Strategy: The Right Way

You’ll want to start with mobile. That’s not just industry advice — it’s practical. Build your base styles for a 320px phone screen first. Then, as the screen gets bigger, you’ll add more complex layouts and features.

This approach forces you to prioritize. What’s essential? What can wait? On mobile, every pixel matters. You’re not hiding things or cramming them in — you’re actually designing for the smallest constraint and expanding from there. It’s cleaner, faster, and your mobile users get a proper experience instead of a squeezed desktop site.

Pro tip: Most mobile traffic comes from 375px–428px width phones. That’s your sweet spot for testing.

Code editor showing CSS media query syntax with mobile-first approach and breakpoint declarations

Standard Breakpoints You’ll Use

These sizes cover 95% of devices people actually use to browse the web.

Mobile

320px – 480px

Single column layout. Full-width buttons. Large touch targets (at least 44px). Navigation collapses into a menu. Images stack vertically.

Small Tablet

481px – 768px

Two-column layouts start here. You can begin using side-by-side navigation. Images can be wider. More breathing room for content.

Large Tablet

769px – 1024px

More complex layouts are safe. Three-column grids work well. Navigation can be horizontal. Features from desktop start appearing.

Desktop

1025px+

Full design freedom. Multi-column layouts. Hover states matter here. Sidebars, complex navigation, advanced features. Max-width containers around 1200px.

Developer writing CSS code with media query syntax on computer screen in modern office

Writing Media Queries: The Syntax

The actual code is straightforward. You’re using the @media rule followed by a condition. Here’s what it looks like:

@media (min-width: 768px) {
    .sidebar {
        display: flex;
        width: 300px;
    }
    .main-content {
        flex: 1;
    }
}

This says: “When the screen is 768px wide or larger, show the sidebar as a fixed width and let the content take up the remaining space.” You’re not hiding elements — you’re changing their display properties.

You’ll typically use min-width for mobile-first (start small, add features as screen grows). You can also use max-width if you’re working desktop-first, but mobile-first is better for performance.

Practical Tips That Actually Work

Real strategies for avoiding common breakpoint mistakes.

01

Test at Real Breakpoints

Don’t just resize your browser window randomly. Open developer tools and set the exact viewport widths: 375px, 768px, 1024px. That’s where you’ll catch layout issues.

02

Avoid Too Many Breakpoints

Three or four breakpoints is plenty. More than that and you’re spending time tweaking instead of building. Your mobile layout should scale smoothly between breakpoints without breaking.

03

Use Flexible Units

Combine media queries with percentages, max-width, and flexbox. Don’t rely on media queries alone to fix everything. Let your base styles do most of the heavy lifting.

04

Content-Based Breakpoints

Some designers set breakpoints where content actually breaks. If your text becomes unreadable at 650px, that’s your breakpoint. Don’t force standard sizes if they don’t match your design.

A Real Example: Navigation Menu

Let’s walk through how you’d actually implement a responsive menu. On mobile, it’s a hamburger icon. On tablet and up, it’s horizontal.


.nav-menu {
    display: none;
}

.menu-toggle {
    display: block;
    font-size: 24px;
}

@media (min-width: 768px) {
    .nav-menu {
        display: flex;
        gap: 2rem;
    }
    
    .menu-toggle {
        display: none;
    }
}

That’s it. You’re not hiding complexity — you’re managing what shows at different sizes. The JavaScript for the hamburger menu toggles that display property on click, but the media query handles the automatic layout switch.

Responsive navigation menu showing hamburger icon on phone and horizontal menu on desktop in side-by-side comparison

Tools for Testing Breakpoints

These tools help you verify your breakpoints work correctly.

Chrome DevTools

Built into every browser. Use the device toolbar to test specific viewport sizes. It’s your primary testing tool — use it constantly while building.

Responsively App

Free desktop app that shows multiple viewports side by side. Perfect for seeing how your layout adapts across different sizes simultaneously.

Real Devices

Always test on actual phones and tablets. Emulators are close but not perfect. A real iPhone 12 shows touch behavior and performance that simulators can’t replicate.

Google Analytics

Check which devices your actual users are on. That data tells you exactly which breakpoints matter for your audience. Don’t guess — use real numbers.

Start Building Responsive Sites

Media queries aren’t complicated once you understand the pattern. Start with your mobile layout, pick 3-4 strategic breakpoints, and test as you build. You’ll develop an intuition for what works and what doesn’t. The best way to learn? Build something. Pick a design, implement the breakpoints, and see how it feels on different devices.

Explore More Guides

About This Guide

This article provides educational information about responsive web design and media queries. The techniques and breakpoints described are based on current industry standards as of February 2026. Web technologies evolve, and your specific project requirements may differ. For production applications, consult with experienced developers and test thoroughly on your target devices. Browser support varies across devices, so always verify compatibility for your audience.