facebook pixel
10Aug 2026

How to build a responsive website: the complete guide

Desk with responsive web design manual planning tools

A responsive website automatically adapts its layout, images, and content to fit any screen size, from a 320px mobile to a 4K monitor, using a single codebase. That is the definition. Here is what to do with it:

  • Start mobile-first. Design and code for the smallest screen first, then scale up using media queries.
  • Build core components. Create a library of responsive headers, grids, cards, and forms before assembling full pages.
  • Test and deploy. Run Google Lighthouse, Chrome DevTools device emulation, and the Google Mobile-Friendly Test before going live.

This guide covers every technical area you need: media queries and fluid grids, flexible images and lazy loading, Flexbox and CSS Grid, testing and debugging, performance and SEO, and a pre-launch checklist with UK-specific guidance.


Key takeaways

A responsive website built mobile-first, tested on real devices, and optimised for Core Web Vitals is the single most reliable foundation for UK search visibility and user experience in 2026.

Point Details
Mobile-first is non-negotiable Google indexes the mobile version of your site; build and test mobile first, then scale up.
Three core techniques Media queries, fluid grids, and flexible images form the foundation of every responsive build.
Component-level thinking Build responsive cards, navs, and forms as reusable components, not page-by-page layouts.
Test with real tools Use Lighthouse, Chrome DevTools, Google Mobile-Friendly Test, and BrowserStack before launch.
Brainiacmedia can help Brainiacmedia offers responsive builds, audits, and Core Web Vitals optimisation for UK businesses.

Table of Contents

What is responsive web design and why does it matter?

Responsive web design is the practice of building a single website that reshapes itself fluidly across every device viewport, using three core techniques: CSS media queries, fluid grids, and flexible images. The term was coined by Ethan Marcotte in 2010, but the underlying principle has become the default standard for professional web development.

The practical benefits go well beyond aesthetics:

  • User experience. Visitors on any device get a layout designed for their screen, not a shrunken desktop page.
  • Conversion rates. A layout that works on mobile makes CTAs reachable by thumb, which directly affects conversion performance.
  • Maintainability. One codebase means one set of updates, one content strategy, and one analytics view.
  • Performance. Properly implemented responsive design serves appropriately sized assets, reducing page weight on mobile connections.

Responsive vs adaptive vs separate mobile site

These three approaches solve the same problem differently, and the trade-offs are significant.

Approach How it works Maintenance SEO risk
Responsive One fluid codebase scales to any viewport Low — single codebase Minimal when implemented correctly
Adaptive Multiple fixed layouts served by device detection Medium — several templates to maintain Moderate — content parity issues possible
Separate mobile site (m.dot) Entirely separate URL and codebase for mobile High — two sites to update High — duplicate content, redirect chains

Responsive design wins on maintainability and SEO for the vast majority of projects. Adaptive design still has a place in very high-traffic e-commerce environments where per-device optimisation justifies the overhead, but for most UK SMEs and agencies, a well-built responsive site is the right call.

One nuance worth noting: modern devices include foldables, split-screen tablets, and ultra-wide monitors. IONOS highlights that container queries and clamp() for fluid typography are now standard tools for handling these changing form factors, not just the traditional phone-tablet-desktop trio.


Core techniques every responsive site relies on

MDN’s responsive design documentation identifies three foundational techniques: media queries, fluid grids, and flexible images. Modern practice adds the viewport meta tag and fluid typography as equally non-negotiable.

Media queries

A media query applies CSS rules only when a condition is met, typically a minimum or maximum viewport width. The mobile-first approach writes base styles for small screens, then adds min-width queries to enhance for larger ones:

/* Base styles — mobile */
.card {
display: block;
padding: 1rem;
}
/* Tablet and above */
@media (min-width: 48em) {
.card {
display: flex;
gap: 1.5rem;
}
}
/* Desktop */
@media (min-width: 75em) {
.card {
max-width: 1200px;
margin-inline: auto;
}
}

Container queries, now supported across all major browsers, let a component respond to its parent container’s size rather than the viewport. This is particularly useful for reusable components like cards or sidebars that appear in different layout contexts.

Fluid grids and relative units

Replace fixed pixel widths with percentages, fr units, or clamp() so layouts stretch and compress naturally:

/* Fluid typography using clamp() */
h1 {
font-size: clamp(1.5rem, 4vw + 1rem, 3rem);
}
/* Fluid grid */
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 1.5rem;
}

The clamp() function takes a minimum, a preferred value, and a maximum, producing typography that scales smoothly between breakpoints without a single media query.

Viewport meta tag

Without this tag, mobile browsers render the page at a desktop width and then scale it down, breaking every responsive rule you wrote:

<meta name="viewport" content="width=device-width, initial-scale=1">

Place it in every <head>. There is no responsive design without it.

Flexible images

Images need a CSS floor to prevent overflow:

img {
height: auto;
display: block;
}

The srcset and sizes attributes go further, letting the browser choose the most appropriate image file for the current viewport and resolution. Full detail on this is in the images section below.

Pro Tip: Set breakpoints based on where your content breaks, not on specific device pixel widths. Open your design in a browser, drag the viewport narrower, and add a breakpoint the moment the layout looks uncomfortable. This content-first approach, recommended by IONOS, produces far more resilient layouts than chasing device specs.


A practical mobile-first workflow to build a responsive site

The mobile-first approach is not just a design philosophy; it is a technical discipline. Writing CSS for small screens first forces you to prioritise content and strip away decoration, which tends to produce faster, cleaner code.

Step-by-step build checklist

  1. Audit your content. List every piece of content and rank it by importance to the mobile user. Navigation, headline, primary CTA, and key body content come first. Secondary navigation and supplementary content come later.
  2. Define breakpoints. Start with three: a base (no query, ~320px and up), a mid-point (~48em), and a wide (~75em). Add more only when content demands it.
  3. Write base HTML with semantic structure. Use <header>, <main>, <nav>, <article>, <section>, and <footer>. Semantic HTML improves accessibility and gives search engines clear signals about content hierarchy.
  4. Style mobile first. Apply your base CSS without any media queries. The layout should be a single readable column.
  5. Build components, not pages. Create a responsive card, a responsive navigation, a responsive form. Adobe recommends treating responsive design as a component-level discipline rather than page-by-page work, which accelerates future projects significantly.
  6. Add media queries progressively. Introduce min-width queries to adjust layout at each breakpoint. Test at each stage.
  7. Add responsive images. Implement srcset and sizes for all significant images.
  8. Run your QA checklist. See below.

Sample responsive card grid

<section class="card-grid">
<article class="card">
<img src="image.jpg" alt="Description" loading="lazy">
<div class="card__body">
<h2>Card Title</h2>
<p>Card description text.</p>
<a href="#" class="btn">Read more</a>
</div>
</article>
</section>
.card-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 1.5rem;
padding: 1rem;
}
.card {
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.card img {
height: 200px;
object-fit: cover;
}
.card__body {
padding: 1rem;
}

QA checklist before launch

  • Run Google Lighthouse (Performance, Accessibility, Best Practices, SEO) and target scores above 90 in each category.
  • Test in Chrome DevTools device emulation across at least five viewport widths: 320px, 375px, 768px, 1024px, and 1440px.
  • Check Core Web Vitals: LCP under 2.5 seconds, CLS under 0.1, INP under 200ms.
  • Verify touch target sizes are at least 44×44px for all interactive elements.
  • Confirm text remains readable without zooming at 16px base font size or above.
  • Test keyboard navigation through all interactive elements.
  • Validate HTML with the W3C Markup Validation Service.

Flexbox, CSS Grid, or a framework: which should you use?

The choice between Flexbox, CSS Grid, and a framework is not a matter of preference; it depends on the layout problem you are solving.

Flexbox is one-dimensional. It distributes items along a single axis, either a row or a column, and handles alignment and spacing within that axis exceptionally well. Use it for navigation bars, button groups, card content alignment, and any component where items flow in one direction.

CSS Grid is two-dimensional. It controls rows and columns simultaneously, making it the right tool for page-level layouts, image galleries, and any design where items need to align across both axes. The auto-fit and minmax() combination produces intrinsically responsive grids without a single media query.

Frameworks like Bootstrap provide pre-built grid systems, utility classes, and component patterns that accelerate development, particularly for teams or beginners. The trade-off is file size and the effort of overriding default styles to match a custom design.

Layout tool Best for Skill required Customisability Responsive built-in
Flexbox One-dimensional component layouts Beginner–intermediate Full Manual via media queries
CSS Grid Two-dimensional page and section layouts Intermediate Full Intrinsic with auto-fit
Bootstrap Rapid prototyping, team projects Beginner Moderate Yes, 12-column grid
Tailwind CSS Utility-first custom builds Intermediate High Yes, responsive prefixes

For page builders and no-code tools, the picture shifts:

  • WordPress with a block theme (Twenty Twenty-Four and later) produces responsive layouts out of the box, and plugins like Elementor or Kadence add visual control. Brainiacmedia’s WordPress web design service covers bespoke responsive builds on this platform.
  • Webflow generates clean, semantic HTML and CSS with a visual interface, giving designers full responsive control without writing code.
  • Wix and Squarespace handle responsiveness automatically within their editors, making them suitable for small businesses that need a presentable site quickly, though customisation depth is limited.

Handling images, video and media responsively

Images are typically the heaviest assets on any page, and serving the wrong size to a mobile device wastes bandwidth and damages Core Web Vitals scores.

Photo shoot setup illustrating responsive media optimization

srcset and sizes

The srcset attribute tells the browser which image files are available and at what width. The sizes attribute tells it how wide the image will be displayed at each viewport. The browser combines these to pick the most efficient file:

<img
src="hero-800.jpg"
srcset="hero-400.jpg 400w, hero-800.jpg 800w, hero-1600.jpg 1600w"
sizes="(max-width: 48em) 100vw, (max-width: 75em) 50vw, 800px"
alt="Hero image description"
loading="lazy"
width="800"
height="450"
>

Always include explicit width and height attributes. They allow the browser to reserve space before the image loads, preventing layout shift and keeping your CLS score low.

Art direction with the picture element

When you need to serve a fundamentally different crop or composition at different screen sizes, the <picture> element gives you explicit control:

<picture>
<source
media="(min-width: 75em)"
srcset="hero-wide.avif" type="image/avif"
>
<source
media="(min-width: 75em)"
srcset="hero-wide.webp" type="image/webp"
>
<source
srcset="hero-square.avif" type="image/avif"
>
<img src="hero-square.jpg" alt="Hero image" loading="lazy" width="800" height="800">
</picture>

List AVIF first, then WebP, then JPEG as the fallback. AVIF typically achieves the smallest file sizes; WebP is the reliable middle ground; JPEG remains the universal fallback.

Image optimisation checklist

  • Compress all images before upload using tools like Squoosh, ImageOptim, or a CDN with on-the-fly optimisation (Cloudflare Images, Cloudinary, or Imgix all serve UK traffic well).
  • Use loading="lazy" on all images below the fold.
  • Use loading="eager" and fetchpriority="high" on your Largest Contentful Paint image (usually the hero).
  • Set explicit width and height on every <img> tag.
  • Serve images via a CDN with edge nodes in the UK to minimise latency for British users.

Pro Tip: Run your page through Google Lighthouse after adding images. The “Properly size images” and “Serve images in next-gen formats” audits will tell you exactly which files need attention and estimate the potential byte savings.


How to test responsive behaviour and fix common problems

Testing is where responsive design either proves itself or falls apart. A layout that looks perfect in Figma can break on a real device in ways that are invisible in a static mockup.

Tools to use

  • Chrome DevTools device emulation. Open DevTools (F12), click the device icon, and test at preset device sizes or drag the viewport manually. Use the “Responsive” mode to catch unexpected breakpoints.
  • Google Lighthouse. Audits performance, accessibility, SEO, and best practices in one run. Available in Chrome DevTools under the “Lighthouse” tab or via the command line with npm install -g lighthouse.
  • Google Mobile-Friendly Test. Enter your URL at search.google.com/test/mobile-friendly to see how Googlebot views your page and whether it passes mobile usability checks.
  • BrowserStack. Real-device cloud testing across hundreds of device and browser combinations, including older Android and iOS versions that are still common among UK users.

Step-by-step debugging

  1. Open Chrome DevTools and set the viewport to 320px. If anything overflows horizontally, you have a layout bug.
  2. Check the Elements panel for any element with a fixed pixel width wider than the viewport.
  3. Use the Computed tab to inspect overflow, width, and max-width on suspect elements.
  4. For navigation issues on mobile, check that your hamburger menu toggle works with keyboard and touch, not just mouse click.
  5. For slow image loading, open the Network tab, filter by “Img”, and check file sizes. Anything over 200KB on mobile warrants compression or a smaller srcset variant.

Common fixes

Horizontal overflow:

* {
box-sizing: border-box;
}
body {
overflow-x: hidden;
}

Touch targets too small:

.btn, a, button {
min-height: 44px;
min-width: 44px;
padding: 0.75rem 1.25rem;
}

Images breaking out of containers:

img, video, iframe {
height: auto;
}

Performance, SEO and accessibility for UK sites

These three areas are deeply connected. A slow, inaccessible site ranks poorly and loses users before they convert.

Mobile-first indexing and SEO

Google’s mobile-first indexing means Google uses the mobile version of your site for crawling, indexing, and ranking. If your mobile template hides content behind tabs, lazy-loaded accordions, or JavaScript that Googlebot cannot execute, that content may not be indexed at all. Mobile and desktop content must be equivalent. Structured data, canonical tags, and Open Graph metadata must appear on the mobile version.

For UK-specific SEO, pairing a technically sound responsive build with strong SEO services and technical SEO work produces the most durable results in Google’s UK index.

Core Web Vitals

Core Web Vitals measure real user experience across three dimensions:

  • LCP (Largest Contentful Paint): how quickly the main content loads. Target under 2.5 seconds. Responsive images with fetchpriority="high" on the hero image and a UK-based CDN are the most direct levers.
  • CLS (Cumulative Layout Shift): how much the page jumps during load. Explicit width and height on images and avoiding dynamically injected content above the fold keeps this low.
  • INP (Interaction to Next Paint): how quickly the page responds to user input. Heavy JavaScript and render-blocking resources are the main culprits.

Accessibility

  • Touch targets must be at least 44×44px for all interactive elements (WCAG 2.1 AA).
  • Base font size should be 16px or above; never use px units for font sizes in media queries (use em so user browser preferences are respected).
  • Ensure keyboard focus is visible on all interactive elements. Do not remove outline without providing an alternative.
  • Use ARIA roles and labels where semantic HTML alone is insufficient, particularly for custom navigation patterns and modal dialogs.
  • Test with a screen reader (NVDA on Windows, VoiceOver on macOS and iOS) at multiple viewport sizes.

Gov recommends responsive design combined with progressive enhancement, meaning the core content and functionality work without JavaScript, with enhancements layered on top. This approach meets UK public sector accessibility expectations and is good practice for any site serving a broad UK audience.


Responsive sites worth studying and what to look for

Learning from exemplary sites is one of the fastest ways to build your own pattern library. The goal is not to copy, but to identify the specific responsive decisions that make a layout work, then adapt the principle.

  • GOV.UK. The gold standard for accessible, progressive-enhancement-first responsive design. Study how navigation collapses, how form elements scale, and how content hierarchy is maintained across all viewports. The typography system uses relative units throughout.
  • BBC News. Observe how the card grid reflows from a four-column desktop layout to a single column on mobile, and how images are cropped differently per breakpoint using art direction.
  • The Guardian. A masterclass in responsive typography and reading experience. Notice how line length is controlled across viewports to maintain readability, and how the navigation adapts without a traditional hamburger menu on tablet.
  • Shopify (merchant storefronts). Study how product grids, image galleries, and add-to-cart buttons adapt across devices. The thumb-friendly CTA placement on mobile is worth examining closely, particularly in relation to effective call-to-action design.
  • Airbnb. Watch how the search interface transforms between mobile and desktop. The component-level responsive approach means each UI element adapts independently rather than the whole page reflowing at once.
  • Monzo. A UK-native example of clean, fast responsive design. The hero section, feature cards, and pricing tables all reflow gracefully. Performance scores are consistently high.
  • NHS.uk. Another UK public sector example demonstrating accessible responsive patterns, particularly for forms, error messages, and data tables.
  • Stripe. Study the hero animations and how they degrade gracefully on lower-powered mobile devices, and how the documentation layout adapts from a two-column desktop view to a single-column mobile view.

When you find a pattern you want to learn from, open Chrome DevTools, resize the viewport, and inspect the CSS. Look for how grid-template-columns, flex-wrap, and media queries interact. Then build your own version from scratch rather than copying the code directly.


Developer checklist and UK considerations before you launch

A pre-launch checklist prevents the most common and costly mistakes. This one is structured around the areas that matter most for UK teams.

Pre-launch checklist

  • Mobile-first content parity. Every piece of content on desktop is present and accessible on mobile. No content hidden from mobile that Google needs to index.
  • Viewport meta tag present in every <head>.
  • Responsive images with srcset, sizes, explicit dimensions, and loading="lazy" on all below-fold images.
  • Core Web Vitals pass in Lighthouse: LCP under 2.5s, CLS under 0.1, INP under 200ms.
  • Accessibility audit passes WCAG 2.1 AA. Run axe DevTools or WAVE alongside Lighthouse.
  • Touch targets are at least 44×44px.
  • Canonical tags are consistent between mobile and desktop (for responsive sites, this is automatic since there is one URL).
  • Structured data (Schema.org) is present and valid on the mobile version.
  • Analytics (Google Analytics 4 or equivalent) is configured and tracking mobile vs desktop segments.
  • SSL certificate is active and HTTPS is enforced.

UK-specific notes

GOV.UK’s service manual recommends progressive enhancement as a baseline for any service that needs to work reliably across the full range of UK devices, including older handsets on slower connections. For public-facing services, this is a compliance expectation, not a suggestion.

For hosting, UK-based or UK-edge options reduce latency for British users. Cloudflare’s network has extensive UK edge coverage. AWS CloudFront, Google Cloud CDN, and Fastly all have London-region nodes. For smaller sites, UK-based managed hosting providers like Krystal (which also offers green hosting) or IONOS UK provide solid performance without the complexity of cloud infrastructure.

Pro Tip: Register your site with Google Search Console and submit a sitemap immediately after launch. Monitor the “Mobile Usability” report under “Experience” for any issues Google’s crawler encounters on your responsive pages. Fix any flagged issues within the first week, before they affect indexing.


How to optimise for different UK browsers and devices

The UK browser market is dominated by Chrome, followed by Safari (driven by iPhone penetration), Edge, and Firefox. Each has quirks that affect responsive layouts.

Chrome is the most forgiving and the best-supported browser for modern CSS. Container queries, clamp(), aspect-ratio, and CSS Grid subgrid all work reliably. Use Chrome DevTools as your primary development environment.

Safari on iOS has historically lagged on certain CSS features. Check caniuse.com before using newer properties. Flexbox gap was not supported in Safari until version 14.1 (2021), so if your analytics show a meaningful proportion of older iOS users, test explicitly. The iOS Safari viewport height issue (100vh including the browser chrome) is a known problem; use dvh (dynamic viewport height) units where supported, with a vh fallback.

Edge is Chromium-based and behaves almost identically to Chrome for CSS purposes. Test it primarily for JavaScript compatibility if you use newer APIs.

Firefox has excellent CSS Grid and Flexbox support and is the most standards-compliant browser. It is a good secondary testing environment because it surfaces edge cases that Chrome sometimes masks.

For devices, UK mobile usage skews heavily towards mid-range Android handsets alongside iPhones. Test on a real mid-range Android device (or use BrowserStack’s real-device cloud) rather than relying solely on high-end emulation. Mid-range devices have slower CPUs, which exposes JavaScript performance issues that a MacBook running Chrome DevTools will never reveal.

Older UK users are more likely to use tablets and larger-screen devices. Test your layout at 768px and 1024px widths carefully; these breakpoints often receive less attention than the extremes.


How to optimise for different UK browsers and devices — overview diagram

Step-by-step guide to deploying a responsive website

Deployment is where many well-built sites encounter avoidable problems. A structured process prevents the most common pitfalls.

Deployment steps

  1. Freeze your codebase. Merge all feature branches, run your full test suite, and tag a release version in your version control system (Git).
  2. Run a final Lighthouse audit on the staging environment. Fix any regressions before touching production.
  3. Check environment variables and configuration. API keys, CDN origins, and CORS headers often differ between staging and production. Verify each one.
  4. Upload or deploy to your hosting environment. For static sites, Netlify, Vercel, or Cloudflare Pages offer one-command deploys with automatic CDN distribution. For WordPress or CMS-based sites, use a staging-to-production push workflow rather than editing live.
  5. Verify SSL and HTTPS redirects. All HTTP traffic should redirect to HTTPS. Check that your SSL certificate covers all subdomains you use (including www).
  6. Submit your sitemap to Google Search Console and Bing Webmaster Tools.
  7. Set up uptime monitoring. Tools like UptimeRobot (free tier) or Better Uptime alert you immediately if the site goes down.
  8. Monitor Core Web Vitals in Google Search Console’s “Core Web Vitals” report for the first 28 days. Real-user data takes time to accumulate, but early signals are worth watching.

Common pitfalls and how to avoid them

Forgetting to test on a real device after deployment. Staging environments sometimes serve assets from different origins or with different caching headers. Always test on a real phone after going live.

Missing redirects from old URLs. If you changed URL structure during a redesign, set up 301 redirects for every changed URL. Missing redirects lose link equity and create 404 errors for users who bookmarked old pages.

Deploying without a rollback plan. Keep your previous deployment accessible so you can revert within minutes if something breaks. Netlify and Vercel make this trivial with one-click rollback. For server-based deployments, keep the previous release directory intact.

Not updating your CDN cache after deployment. If your CDN aggressively caches assets, users may see stale CSS or JavaScript after a deployment. Purge the CDN cache immediately after deploying, or use cache-busting file names (content hashes in filenames, which tools like Webpack and Vite handle automatically).

Ignoring mobile performance on the live server. A site that scores 95 on Lighthouse locally can score 60 on a shared hosting environment with slow time-to-first-byte. Measure real-world performance with PageSpeed Insights after deployment, not just local Lighthouse runs.


The part of responsive design most agencies get wrong

There is a persistent gap between what responsive design promises and what most sites actually deliver. The gap is not technical; it is strategic.

Most teams treat responsiveness as a checkbox. They add the viewport meta tag, use a Bootstrap grid, and call it done. What they miss is that mobile users are not just desktop users on smaller screens. They are often in a different context entirely: on the move, with one hand, under time pressure, on a slower connection. The content hierarchy that works for a desktop user browsing at a desk may be completely wrong for a mobile user trying to find a phone number or a store address.

Adobe’s guidance makes this point clearly: use data to guide which content and interactions to prioritise per device. Look at your analytics and ask which pages mobile users visit most, where they drop off, and which CTAs they tap. Then redesign those specific components for mobile first, with the desktop version as the enhancement.

The second thing most teams underestimate is component-level thinking. Building a “responsive page” is the wrong unit of work. Building a “responsive card component” or a “responsive navigation component” is the right one. When you build at component level, every future page that uses those components is responsive by default. This is what separates teams that ship responsive sites quickly from those that rebuild the same patterns from scratch on every project.


Brainiacmedia’s responsive web development service

Building a responsive website well takes more than knowing the techniques. It takes a disciplined process, real-device testing, and the experience to know which trade-offs matter for your specific audience and goals.

Brainiacmedia

Brainiacmedia’s web development team builds responsive sites from the ground up using a mobile-first workflow, component-level architecture, and a pre-launch QA process that covers Lighthouse scores, Core Web Vitals, accessibility, and UK browser compatibility. Whether you need a bespoke build, a WordPress responsive redesign, or an audit of an existing site that is underperforming on mobile, the team covers it.

Services included:

  • Responsive design audit of your current site
  • Mobile-first build or redesign
  • Core Web Vitals and performance optimisation
  • Hosting and CDN configuration advice for UK audiences
  • Post-launch SEO and technical SEO support

Get in touch via the Brainiacmedia website development page to discuss your project or request a free audit.


Sources

These are the canonical sources used throughout this guide and the best places to go deeper on each topic:

You'd be Mad to Miss This!
FREE Website & SEO Audit
Claim Yours

Find out how you can get more visitors to your website and boost sales and conversions.