How to make a website mobile friendly: 9 fixes that matter
Kofi Agyem, Founder and CEO, CloudzyroPublished · 8 min read
On this page
- 1. The short answer
- 2. Fix 1: add the viewport meta tag
- 3. Fix 2: use a flexible layout
- 4. Fix 3: make images and media resize
- 5. Fix 4: make text readable without zooming
- 6. Fix 5: give buttons and links room to tap
- 7. Fix 6: make forms easy to fill in
- 8. Fix 7: make the menu work on a phone
- 9. Fix 8: watch tables, popups and fixed elements
- 10. Fix 9: make it fast on mobile data
- 11. How to test it
- 12. If you use a website builder or WordPress
- 13. Let AI do the fixing
- 14. Sources
How to make a website mobile friendly: the viewport tag, flexible layouts, images, readable text, tap targets, forms and speed, with code and how to test.
1. The short answer
To make a website mobile friendly, add the viewport meta tag, let your layout shrink and stack with flexible widths and media queries, make images resize, keep text at 16 pixels or more, give buttons room to tap, make forms easy to fill in, and keep pages light so they load fast on mobile data. Then test on a real phone. Most sites need only a handful of these fixes.
Mobile friendliness isn't only about looks. For many sites, most visits come from phones, and Google uses the mobile version of your pages to index and rank them, so a page that's broken on a phone is broken where it counts.
2. Fix 1: add the viewport meta tag
Without this one line, a phone pretends to be a desktop screen about 980 pixels wide and shrinks the whole page to fit, so everything looks tiny. Put it in the <head> of every page:
<meta name="viewport" content="width=device-width, initial-scale=1">Don't add maximum-scale=1 or user-scalable=no. Stopping people from zooming makes the site harder to use for anyone with less than perfect eyesight, and browsers increasingly ignore it anyway.
3. Fix 2: use a flexible layout
Fixed widths such as width: 1200px are the main cause of pages that scroll sideways. Let containers shrink, and use flexbox or grid so columns wrap onto new rows when there isn't room:
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 16px;
}
.cards {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
gap: 24px;
}That grid shows as many 260-pixel-wide cards side by side as fit, and one per row on a phone, with no media query at all. Where you do need different layouts, design for the phone first and add space as the screen grows:
.nav-links { display: none; } /* phone: menu button */
@media (min-width: 768px) {
.nav-links { display: flex; } /* tablet and up: full menu */
.menu-button { display: none; }
}Leave a gutter of at least 16 pixels at each side on phones so text doesn't touch the edges of the screen.
4. Fix 3: make images and media resize
One wide image can push a whole page sideways. This rule stops it, and keeps images in proportion:
img, video, svg {
max-width: 100%;
height: auto;
}Phones also don't need desktop-sized files. Give the browser a choice of sizes with srcset and sizes, and it downloads the smallest one that looks sharp:
<img
src="kitchen-800.jpg"
srcset="kitchen-400.jpg 400w, kitchen-800.jpg 800w, kitchen-1600.jpg 1600w"
sizes="(min-width: 768px) 50vw, 100vw"
width="1600" height="1067"
alt="Our open kitchen during dinner service"
loading="lazy">The width and height attributes let the browser reserve the right space before the image arrives, so text doesn't jump as it loads. Use loading="lazy" on images further down the page, but not on the first big image a visitor sees. Embedded videos and maps need the same treatment: wrap them so they scale, for example with aspect-ratio: 16 / 9; width: 100%.
5. Fix 4: make text readable without zooming
- Body text of at least 16 pixels. Smaller text means pinching and zooming.
- Line height around 1.5 for paragraphs, so lines don't blur together on a small screen.
- Headings that scale down. A 64-pixel desktop heading wraps into five lines on a phone.
font-size: clamp(2rem, 5vw, 4rem)grows with the screen between a minimum and a maximum. - Long words and addresses that wrap. Add
overflow-wrap: anywhereto blocks that hold long URLs or email addresses, a common hidden cause of sideways scrolling. - Enough contrast. Light gray text on white is hard to read on a phone outdoors.
6. Fix 5: give buttons and links room to tap
Fingers are less precise than a mouse pointer. WCAG 2.2, the accessibility standard, asks for targets of at least 24 by 24 CSS pixels, or enough space around smaller ones that a tap can't hit the wrong thing. For main buttons, aim higher: 44 to 48 pixels tall is comfortable for a thumb.
.button {
min-height: 48px;
padding: 12px 20px;
}
nav a {
display: inline-block;
padding: 12px 8px; /* a bigger target, same-looking link */
}Also: put the main action where a thumb can reach it, don't rely on hover (there's no hover on a touchscreen), and make phone numbers and addresses tappable with tel: and map links.
7. Fix 6: make forms easy to fill in
Forms are where phones lose most customers. A few attributes do most of the work:
<label for="email">Email</label>
<input id="email" type="email" autocomplete="email" inputmode="email">
<label for="phone">Phone</label>
<input id="phone" type="tel" autocomplete="tel">- The right `type` brings up the right keyboard:
email,tel,number,date. - `autocomplete` lets the phone fill in names, addresses and cards.
- A visible label above each field, not just placeholder text that disappears when you type.
- Font size of 16 pixels or more in fields. iPhone's Safari zooms in on smaller text when a field is tapped.
- Fewer fields. Ask only for what you need now.
8. Fix 7: make the menu work on a phone
A row of eight menu links doesn't fit on a phone. Either cut the menu to four or five items that fit, or collapse it behind a menu button that opens a full-width list. Make the button a real <button> with an accessible name such as “Menu”, so screen readers announce it, and make sure the open menu can be closed again. Keep the main action, such as Book or Call, visible outside the collapsed menu.
9. Fix 8: watch tables, popups and fixed elements
- Wide tables: wrap them in a container with
overflow-x: autoso only the table scrolls, or show each row as a card on small screens. - Popups: a full-screen popup that appears as soon as the page opens is annoying on a phone and Google treats intrusive interstitials as a poor experience. Make anything that covers the content easy to dismiss.
- Sticky headers and chat buttons: on a short phone screen, a tall fixed header plus a cookie bar plus a chat bubble can cover half the page. Keep fixed elements small.
- `100vh` sections: on phones the browser's toolbars change the visible height. Use
100dvhinstead.
10. Fix 9: make it fast on mobile data
A phone on a cellular connection is slower than your office Wi-Fi, so weight matters more. Google's Core Web Vitals measure what visitors feel, and a page is good when its Largest Contentful Paint (the main content appearing) is within 2.5 seconds, Interaction to Next Paint (how quickly it responds to a tap) is within 200 milliseconds, and Cumulative Layout Shift (how much things jump around) is 0.1 or less.
- Compress images and serve modern formats such as WebP or AVIF at the size they're shown.
- Load fewer fonts: one or two families, in the weights you use.
- Remove scripts you don't need, especially third-party widgets.
- Give images and embeds their dimensions so nothing shifts as they load.
- Serve static files from a CDN close to visitors. On Cloudzyro, images, CSS and JavaScript are cached by Cloudflare automatically.
11. How to test it
- Real phones first. Open every page on your own phone, ideally on mobile data, and on a friend's phone of the other kind (iPhone or Android).
- Chrome DevTools device mode. Press Ctrl+Shift+M (Cmd+Shift+M on a Mac) to preview common phone sizes, and drag the width down to 320 pixels to find anything that breaks.
- Lighthouse. In DevTools, run Lighthouse with Mobile selected for scores on performance, accessibility and SEO, with specific fixes.
- Search Console. Once your site has visitors, the Core Web Vitals report shows how real phones experience it.
Check the same things each time: nothing scrolls sideways, text is readable, buttons are easy to tap, forms bring up the right keyboard, and the main action is visible without hunting.
12. If you use a website builder or WordPress
Builders such as Wix and Squarespace produce responsive layouts, but they can't fix content: check text you've sized by hand, tables you've pasted in and oversized images. Most builders have a mobile preview in the editor; use it on every page. On WordPress, choose a responsive theme, test it on a phone before you commit, and watch plugins that add popups or heavy scripts.
13. Let AI do the fixing
AI builders and coding tools are good at these fixes if you're specific. Instead of “make it mobile friendly”, describe what's wrong: “On screens narrower than 640px, stack the three pricing cards, make the buttons full width and reduce the hero heading to 32px.” Then check on a phone.
In Cloudzyro Agent, check the live preview in a narrow window as you go. When you publish, it checks every page like a visitor would, including how it fits on a phone, and offers to fix what it finds. Starting fresh? Our free website templates are built to work on phones; the Restaurant template, for example, is designed for a phone in a hungry person's hand, and you can edit the Restaurant template with Cloudzyro Agent. Building a whole site from scratch? See how to build a website.
14. Sources
Checked on November 25, 2026.