The phone emulation mode in DevTools is a great tool, but it lies a little: it draws the right screen sizes and doesn’t reproduce what a real mobile browser does. It has an address bar that hides and shows, a keyboard that eats half the screen, a camera cut-out and a home gesture bar. Here are seven places where a layout that’s flawless on a laptop breaks in a person’s hand.
1. “100vh” is a lie
On a phone the browser’s address bar comes and goes. The 100vh unit is calculated for the largest case, i.e. when the bar is hidden. As a result a “full screen” block ends up taller than the visible area, and the button at the bottom of the first screen hides behind the edge.
The solution is the newer units: svh (small viewport, bar visible), lvh (large) and dvh (dynamic, changes with the bar). For a hero section, min-height: 100svh is the safe pick: everything important is guaranteed to fit, and extra space does no harm.

2. The iPhone zooms in when you focus a field
You tap an input and the page suddenly zooms in and stays that way. That’s iOS Safari “helping” when the field’s font is smaller than 16 pixels. Don’t forbid zooming with user-scalable=no — that fails accessibility: people with low vision need zoom. The right solution is boring: font-size: 16px (or more) on every input, select and textarea.
3. The notch, rounded corners and the home bar
Modern phones have regions covered by the system: the camera cut-out, rounded corners and the gesture bar at the bottom. A fixed “Call” button near the bottom edge ends up under the bar and is hard to hit. The viewport-fit=cover meta tag and padding through env(safe-area-inset-bottom) help:
padding-bottom: max(16px, env(safe-area-inset-bottom));
max() is needed so that on phones without a cut-out the padding doesn’t collapse to zero.
4. Hover that isn’t there
On a touch screen, after tapping a button the :hover state can “stick” — the button stays highlighted until you touch elsewhere. Wrap styling that only makes sense with a mouse in a condition:
@media (hover: hover) and (pointer: fine) { .card:hover { … } }
And anything hidden behind hover (tooltips, extra buttons) needs an alternative for touch.
5. Horizontal scroll from nowhere
The page slides sideways and you can’t tell who is to blame. Three frequent suspects:
width: 100vw. On desktop the unit includes the scrollbar width, so the block is wider than the page. Use100%.- A long word or link without breaks.
overflow-wrap: anywherehelps. - A flex or grid child that refuses to shrink: such items default to
min-width: auto, so long content stretches the parent. Addmin-width: 0.
Don’t treat the symptom with overflow-x: hidden on body — you’d hide the problem rather than remove it, and break position: sticky along the way. Find the culprit: in the DevTools console, compare each element’s width to the window’s.
One script for all cases. Paste into the console: [...document.querySelectorAll('*')].filter(e => e.scrollWidth > innerWidth) — you get a list of suspects.
6. The keyboard eats the screen
When the on-screen keyboard opens it covers part of the page, and fixed elements — a bottom bar, a chat, a “Send” button — behave differently across browsers: they jump up or stay under the keyboard. Don’t assume the field will always be visible. Scroll the active field into view, avoid pinning important buttons to the very bottom of a form with fixed positioning, and always test forms on a real phone — it’s the only honest way.
7. Fingers are thicker than a cursor
The recommended tap target is 44–48 pixels (WCAG 2.2 requires at least 24, but that is a floor, not a goal). Links in footnotes, close icons and tiny checkboxes turn into a shooting range on touch screens. To avoid enlarging the visual element, enlarge the hit area — through padding or a pseudo-element — and keep at least 8 pixels between neighbours.

Container queries: responsive without caring about the screen
Familiar media queries look at the width of the window. But a card in a sidebar and the same card at full width are different situations at the same screen size. Container queries (@container) let a component adapt to its parent’s width, so such components can go anywhere without rewriting styles. They’re supported in all modern browsers — time to use them.
Fluid sizes: clamp() instead of ten media queries
It used to be that font sizes and spacing changed in steps: “at 768 pixels — 20, at 1024 — 24, at 1440 — 32”. Now one function does the same: font-size: clamp(1.25rem, 1rem + 1.2vw, 2rem) — never below 1.25rem, never above 2rem, and in between it grows smoothly with the window width. Less code, and no jumps on “in-between” screens such as tablets in portrait.
There is a non-obvious trap, though. If you set a size in vw units only (say font-size: 3vw), the text stops growing when the page is zoomed — a person with low vision taps “zoom” and the size stays the same. That violates the WCAG requirement that text can be resized up to 200%. So always combine vw with rem, as in the example above: part of the value depends on user settings, and zoom works.
The same trick works for spacing and grids: padding-inline: clamp(16px, 4vw, 56px) replaces three media queries. And for a card grid, grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) is often enough — columns rearrange to the width on their own, without a single breakpoint. The fewer “if the screen is such-and-such” rules in your CSS, the fewer places where the layout can break on a screen you didn’t think of.
Checklist before handover
- Open the site on two real phones — an iPhone and an Android — and walk through the main scenario.
- Check a 320-pixel width: that’s where most things break.
- Fill in the whole form, keyboard and submit included.
- Rotate to landscape: the small height breaks sticky headers.
- Increase the system font size — the site should survive.
Mobile layout is not a “shrunk desktop version” but a product of its own. If you want a site that works equally well in the hand and on a desk, tell us about your project.



