Dashboard

What Is Responsive Design? A Test for AI-Built Pages

Responsive design means one page that adapts to any screen. Here are the three building blocks and a ten-minute test for pages an AI tool built.

Cecilia Iona
Cecilia Iona
Senior Editor, AI & Product
27 October 20261 min read

Responsive design is an approach to building web pages so that one page renders well on every screen size and resolution while staying easy to use. It is not a single feature you switch on. MDN calls it "an approach", a set of habits for building layouts that respond to whatever device is showing them, and the term was coined by Ethan Marcotte in 2010.

If you built a site with an AI tool, this is the quality check that matters most, because many visitors will arrive on a phone, and a layout that was only ever checked on a wide laptop screen can break there.

The three building blocks

Marcotte's original idea combined fluid grids, fluid images, and media queries. Today that still holds, with a few modern names.

1. Flexible layouts

Instead of fixing a column to 960 pixels, you let the layout share the space it has. Flexbox and CSS Grid are responsive by default. In MDN's flexbox example, "flex items shrink or grow, distributing space between the items according to the space in their container."

css
.container { display: flex; }
.item { flex: 1; }

Three equal columns written with Grid look like this:

css
.container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}

The fr unit means "a fraction of the free space", so the columns resize with the window.

2. Flexible images

An image with a fixed width of 1200 pixels will overflow a 390 pixel phone screen. MDN's one-line fix keeps media inside its container:

css
img, picture, video { max-width: 100%; }

For bandwidth and cropping, the <picture> element and the srcset and sizes attributes let the browser pick a better file for the screen.

3. Media queries

A media query applies CSS only when a condition is true, usually the width of the screen. The point where a layout changes is called a breakpoint.

css
@media screen and (width >= 600px) {
  .wrapper {
    display: grid;
    grid-template-columns: 1fr 2fr;
    column-gap: 5%;
  }
}

MDN recommends defining breakpoints with relative units rather than the sizes of specific devices, and notes that "media queries can help with RWD, but are not a requirement." A layout built on flexible grids can need very few of them.

The one tag you must not forget

Every responsive page needs the viewport meta tag in its <head>:

html
<meta name="viewport" content="width=device-width" />

MDN says to "always include" it, and explains why: mobile browsers "tend to lie about their viewport width". Without the tag, a phone may lay the page out as if the screen were about 980 pixels wide and then shrink the result. Your carefully written narrow-screen layout never switches on.

Mobile first

Mobile first means you design the simple single-column version for a narrow screen, then add multi-column layouts as space allows. It tends to produce cleaner CSS because the default is the simple case and wider screens add rules, instead of narrow screens undoing them.

A ten-minute test for AI-built pages

AI tools write responsive code most of the time, and they are good at it. The failures are specific and easy to spot if you look for them. Run this on any page before you publish it. You only need a browser with developer tools, and no coding.

  1. Check for the viewport tag. View the page source and search for viewport. If it is missing, add it first, since nothing else will work properly.

  2. Resize to 320 pixels wide. Open developer tools, switch to the device toolbar, and set a very narrow width. Scroll down the page.

  3. Look for sideways scrolling. If the page scrolls horizontally, something is wider than the screen. Usually a table, a code block, an image, or an element with a hard-coded width.

  4. Tap-test every button and link. Are they big enough and far enough apart to hit with a thumb?

  5. Zoom text to 200 percent. Does anything overlap, get clipped, or disappear behind another element?

  6. Rotate to landscape. Fixed-height sections often break here.

  7. Read it at the widest size too. A 2000 pixel monitor can leave a small, lonely column of text in the middle.

When you find a problem, describe it exactly to your AI tool, with the width at which it happens. "The pricing table overflows at 390 pixels wide" gets a better fix than "make it mobile friendly". If a layout stays stubborn, the walkthrough on debugging a CSS layout with AI shows how to give the model the right context.

Common causes of broken layouts

  • Fixed widths such as width: 1200px on a container.

  • Tables with many columns and no scroll wrapper.

  • Absolutely positioned elements that were placed by eye on one screen.

  • Images without a max width.

  • Very long unbroken text, like a URL or an email address, pushing a box wider.

If your project uses Tailwind, the same ideas appear as prefixes like md: and lg:. The guide to converting CSS to Tailwind with AI covers how those map across.

Responsive is not the same as accessible

A page can fit every screen and still be hard to use for someone with low vision or a screen reader. They overlap, since zoom and tap size matter for both, but they are separate checks. See how to make an AI-built app accessible. If you want a native app rather than a responsive site, read whether AI can build a mobile app. The bigger picture of shipping something real lives in the guide to how to build an app with AI.

FAQ

What is responsive design in simple terms?

It is building one web page that adjusts its layout to fit any screen, from a phone to a wide monitor, instead of building separate sites.

What is the viewport meta tag?

A line in the page head that tells mobile browsers to use the real device width. Without it, many phones render the page at a wider default width and shrink it.

What is the difference between responsive and adaptive design?

Responsive layouts flex continuously as the screen size changes. Adaptive designs switch between a few fixed layouts at set widths.

What does mobile first mean?

You write the small-screen layout as the default and add rules for larger screens. It keeps the CSS simpler and the narrow layout well tested.

How do I test if my website is responsive?

Use your browser's developer tools to resize the page, check 320 pixels wide, look for sideways scrolling, and then try the page on a real phone.

How did this land?

About the author

Cecilia Iona
Cecilia Iona

Senior Editor, AI & Product

Cecilia leads the Swarmz editorial desk. She has spent a decade turning complex AI and product topics into writing people actually finish, and she owns the blog's quality bar.

Share

Get the next post in your inbox

One email a month. Product updates, engineering posts, and the best of Built with Swarmz.

I agree to receive emails about AI building tips and Swarmz product news. Unsubscribe any time.