Guides · Responsive

Build a responsive and mobile-first website

Thinking mobile-first does not mean sacrificing desktop. It is a way to build interfaces that are clearer, more flexible, and more reliable across every screen size.

Why start with mobile

Mobile forces stricter choices: less space, less room for detours, and more sensitivity to overflow issues. When a page is clear on a small screen, it usually adapts much more easily to tablet and desktop.

A mobile-first approach pushes you to prioritise information, reduce unnecessary components, and strengthen readability before adding richer visual enhancements.

Lay the right foundations

Declare a coherent viewport

The viewport tag lets the mobile browser interpret the width of the page correctly. Without it, the interface may look tiny or scale badly.

Build a flexible grid

Prefer relative widths, fluid grids, and coherent spacing. The goal is for blocks to adapt to content rather than depend on fixed widths.

Use suitable units and fluid media

Relative units such as rem, em, %, or fr make interfaces more flexible. Images need to follow the same logic to avoid overflow.

  • Avoid locking widths in pixels by default.
  • Make sure images can shrink within their container.
  • Also test long elements: URLs, buttons, cards, and lightweight tables.

Refine touch interactions

On mobile, a button can look visually correct and still be frustrating to use if its tap target is too small. Spacing, text size, and touch areas therefore have a direct impact on usability.

  • Leave enough space between important actions.
  • Avoid overloaded menus or labels that are too long.
  • Check that forms remain comfortable to fill in with a thumb.

Track horizontal overflow

A site can look responsive at first glance and still create horizontal scrolling because of a block that is too wide, an unconstrained image, or code content handled poorly.

The best reflex is to test important pages on several real or simulated sizes, then fix the elements that break reading or navigation.

Good and bad examples

Good practices

Layout

One readable column on mobile, then a richer grid when more space is available.

Images

Fluid media that stay inside their container.

Actions

Readable buttons with comfortable touch targets.

Avoid

Layout

A fixed desktop-first grid squeezed afterwards onto mobile.

Content

Cards or long URLs that overflow and force horizontal scrolling.

Interaction

Buttons that are small, too close together, or hard to tap with a finger.

Mini checklist before publishing

  • The viewport tag is properly defined.
  • The layout remains readable in one column on mobile.
  • Images and media resize without breaking the page.
  • No horizontal overflow appears on narrow screens.
  • Buttons and fields stay usable on touch devices.
  • The rendering is checked on mobile, tablet, and desktop.

Conclusion

A responsive and mobile-first site mostly rests on simple, coherent foundations. When the layout adapts naturally, the design becomes more robust and the experience more reliable across every screen.