Category: Websites and UX

Mobile Viewport Jumps During Scrolling: CSS Fixes

Read this guide in Polish

On iPhone, the background or sections of the page jump while desktop looks normal. On mobile devices, the height of the visible area changes when scrolling and hiding the browser bar.

Where's the problem coming from?

100vh does not always behave like the height of the visible area when the browser bar appears. Additionally, dimensionless images and animations can cause CLS.

What to do step by step?

1. Play a problem on the real phone and tell the difference in the height of the viewport from moving items.

2 . Check the elements with height:100vh and consider 100svh or 100dvh according to the project needs.

3 . Book a size for photos, fonts, and cards so loading does not move the text.

4 . Reduce transformation animations and fixtures that affect the feeling of motion.

5 . Test Safari, Chrome, screen rotation, screen keyboard and scrolling in both directions.

Correction test and important trap

The sections remain stable and the elements do not block the contents after the browser bar has been drawn.

Do not add another random min-weight without finding an item that actually changes size.