# Disable scrolling on mobile

**URL:** https://discourse.processing.org/t/disable-scrolling-on-mobile/20719
**Category:** p5.js
**Created:** [May 10, 2020, 5:38pm UTC](https://discourse.processing.org/t/disable-scrolling-on-mobile/20719 "2020-05-10T17:38:57Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![calfish](https://avatars.discourse-cdn.com/v4/letter/c/90ced4/32.png) [@calfish](https://discourse.processing.org/u/calfish)
#### Post date: [May 10, 2020, 5:38pm UTC](https://discourse.processing.org/t/disable-scrolling-on-mobile/20719/1 "2020-05-10T17:38:57Z")

</div>

Hi,  
I am working on a sketch where the user moves objects around. on mobile moving objects also causes the page to scroll around which is very annoying.  
I have found posts addressing this issue but am still confused. I know i may have to use "touch-action; none " in css however i don’t know how to correctly put this in my css file and it still isn’t affecting scroll.  
Any solutions would be very much appreciated !

-Cal

---

<div class="post-metadata">

### Author: ![trinitysenpai](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/trinitysenpai/32/15252_2.png) [@trinitysenpai](https://discourse.processing.org/u/trinitysenpai)
#### Post date: [May 12, 2020, 1:37am UTC](https://discourse.processing.org/t/disable-scrolling-on-mobile/20719/2 "2020-05-12T01:37:26Z")

</div>

Hi There 😄  
I’m not sure if this will work

```auto
html
{
position:fixed;
}

```

Or

```auto
html, body {
margin: 0; 
height: 100%; 
overflow: hidden;
}

```

Hope It Helped 😉

---

<div class="post-metadata">

### Author: ![kizusu](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kizusu/32/18927_2.png) [@kizusu](https://discourse.processing.org/u/kizusu)
#### Post date: [March 30, 2022, 6:15pm UTC](https://discourse.processing.org/t/disable-scrolling-on-mobile/20719/3 "2022-03-30T18:15:58Z")

</div>

For the record, these two pieces seemed to do the trick for me on mobile Safari, depending on the app, and how accessibility is handled:

Css:

```auto
html,
body {
  user-select: none;
  touch-action: none;
  -webkit-user-select: none;
}

```

Html:

```auto
<head>
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0, zoom-factor=1.0, maximum-scale=1.0, user-scalable=no, user-zoom=no"
    />
</head>

```
