Mobile-First Design

Learn why starting with mobile styles and adding complexity for larger screens leads to better websites.

Step 1 of 4

The problem with desktop-first

Many developers instinctively design for desktop first — they build a complex multi-column layout, then try to squeeze it into a phone screen using max-width media queries. This approach has serious problems. First, mobile users (who make up the majority of web traffic) download all the complex desktop CSS even though they never use it. Second, it's much harder to simplify a complex layout than to enhance a simple one. You end up writing lots of override rules to undo desktop styles on mobile: hiding sidebars, unstacking columns, shrinking fonts. It feels like you're fighting your own code.

Mobile-first flips this approach: you write the simplest styles first (for mobile), then progressively add complexity for larger screens using min-width media queries. The base CSS is lean and fast — perfect for phones on slow connections. Larger screens add features: extra columns, visible sidebars, larger images. This strategy is called progressive enhancement — start with a solid foundation and layer on improvements. Google, GitHub, and most modern web teams design mobile-first because it produces smaller CSS files, fewer override hacks, and a better experience for the majority of users.

Think of it this way: Mobile-first is like packing for a trip. If you start with a huge suitcase (desktop), you'll bring everything and then struggle to fit it into a carry-on (mobile) at the last minute. But if you start with a carry-on (mobile) and pack only the essentials, you already have a working bag. If you later upgrade to a bigger suitcase (desktop), you just add nice-to-haves. Starting small and adding is always easier than starting big and cutting.
Web Standard
Progressive enhancement is a core web design philosophy. The basic content and functionality should work on the simplest devices, with enhanced experiences layered on for more capable devices. Mobile-first CSS is the practical application of this principle: the base styles are the mobile layout, and media queries progressively enhance for larger viewports.
Learn more on MDN