# Stop Sideways Scrolling on Phones

> Prevents the whole page from scrolling sideways on phones when a wide image, embed or full-width block sticks out a few pixels past the screen edge.

- Type: CSS
- Runs: Site-wide header
- Category: [Frontend & Design](https://wpide.com/library/category/frontend/)
- Tags: mobile, layout, overflow, css
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/frontend-prevent-horizontal-scroll/

## Code

```css
html,
body {
    overflow-x: clip;
}
```

## Notes

Uses overflow-x: clip, which does not break sticky headers the way overflow: hidden does. It hides the symptom; check which element is too wide if you can.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Stop Sideways Scrolling on Phones" in its snippet library and add it in one click; or create a new CSS snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
