Is your site tiny or clumsy on a phone? Here is how to make a website mobile friendly: add the viewport tag, let layouts and images flex, and size taps for thumbs.
This guide belongs to our web design basics series, which covers the fundamentals of building pages people can actually use.
| Item | Value |
|---|---|
| Desktop width many mobile browsers fake without a viewport tag | about 980px |
| Recommended max-width for images | 100% |
| Minimum scaling WCAG asks for, per MDN | 2× scaling |
| Zoom level MDN calls best practice | 5× zoom |
These figures come from web.dev’s responsive design basics and MDN’s viewport guide. Guidance can change, so check the source before you rely on them.
Start with the viewport meta tag
The viewport tag is the first fix, because phones otherwise behave as if they were desktops. According to web.dev, mobile browsers render the page at a desktop width, usually about 980px, and then scale everything down. Visitors end up pinching and zooming just to read a sentence.
Add this line inside the head of every page:
<meta name=”viewport” content=”width=device-width, initial-scale=1″>
The width=device-width part makes the page match the screen’s width. Adding initial-scale=1 matters when a phone is turned sideways, because some browsers otherwise keep the page width fixed and zoom instead of reflowing, as web.dev describes.
Resist the urge to lock zoom with maximum-scale or user-scalable=no. MDN warns that disabling zoom keeps people with low vision from reading and understanding the page.
Build layouts that flex instead of fixed widths
A responsive layout changes shape with the screen. web.dev gives the example of a single column on a phone, two columns on a tablet, and three or four columns on a desktop computer.
Skip designing for one particular device. Build a flexible grid and change the layout when the content starts to look wrong, advice that web.dev’s accessibility guide repeats.
Modern CSS does most of the work, and web.dev lists three tools:
- Flexbox fits items of different sizes into a row, or wraps them onto more rows as space shrinks.
- CSS Grid builds flexible grids, including the fr unit for a share of the available space.
- Multicol flows text into columns that adapt to the width.
A grid can also fit as many cards per row as there is room for. In the web.dev demo, each card has a minimum size of 200px, and the number of columns drops as the screen narrows.
Decisions like these are easier when they are settled before any code is written, which is where our web design process guide helps.
Keep images and embeds inside the screen
Sideways scrolling is the classic sign of an unfriendly mobile page. web.dev says forcing visitors to scroll horizontally or zoom out causes a poor experience, and an oversized image is a common culprit.
Add this to your style sheet: img { max-width: 100%; display: block; }. A max-width of 100% lets images shrink to the available space but never stretch past their original size, as web.dev recommends.
Still give every img tag width and height attributes. The browser can then reserve space before the file loads, which helps prevent layout shifts, according to web.dev.

Embeds need extra care. Digital.gov cautions that third-party widgets, frames and videos may need another way of being sized for each screen.
Why do tap targets and text size matter?
Fingers are blunter than cursors, so tap targets need room. web.dev suggests 48px as a good size for any tappable element, so a link can be hit without catching its neighbour.
Size text in relative units such as em or rem, not pixels. Some browsers resize text only through user preferences, and pixel-sized copy ignores that setting, as web.dev explains.
Watch your wording too. Phrases like “the menu on your left” can stop making sense once navigation moves on a small screen, a point raised in the same web.dev guide.
Our website accessibility checklist covers these touches and more in a single pass.
Test on real screens and keep zoom working
Lighthouse offers two audits that web.dev points to: one checks the viewport tag, and the other flags content that is not sized correctly for the viewport. Pair them with a hands-on check:
- Narrow your browser window and look for any sideways scrolling.
- Tab through the page at each breakpoint and confirm the order still makes sense, as web.dev advises.
- Open the page on a real phone and try every button with a thumb.
- Zoom in hard and confirm nothing overlaps or disappears.
Zoom deserves the effort. web.dev notes that a low-vision user might zoom as far as 400%, and a responsive layout simply rearranges itself.
On the standards side, MDN says WCAG requires a minimum of 2× scaling, while the best practice is to enable a 5× zoom.
Frequently asked questions
Do I need a separate mobile site?
Show answer
Not with a responsive approach. web.dev describes it as one site whose layout changes to suit the device in use.
Which fix should I make first?
Show answer
Begin with the viewport. Digital.gov calls it a major cause of mobile unfriendliness, and the tag takes a single line to add.
Is it okay to stop visitors from zooming?
Show answer
No. Blocking pinch-zoom shuts out people who need larger content, a risk MDN flags for low-vision users.
What makes a page scroll sideways?
Show answer
Content wider than the screen. Digital.gov traces it mostly to absolute values in CSS or images designed for one specific browser width.



