Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

touch-action — permitted browser gestures

The touch-action property controls permitted touch panning and zooming. It can restrict one axis without unnecessarily disabling zoom.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

touch-action: auto | none | [ [ pan-x | pan-left | pan-right ] || [ pan-y | pan-up | pan-down ] || pinch-zoom ] | manipulation;

touch-action controls permitted browser gestures: auto leaves default handling, while none blocks touch panning and zooming. pan-x and pan-y allow their respective axes; directional variants narrow how panning starts. pinch-zoom allows multi-finger panning and zooming. manipulation means pan-x pan-y pinch-zoom.

The initial value is auto; the property is neither inherited nor animatable. The example uses pan-y pinch-zoom, preserving vertical panning and zooming. It implements neither a carousel nor dragging. Avoid unnecessarily blocking zoom with none.

Examples

<!doctype html>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>touch-action</title>
<style>
  body { min-height: 200vh; }
  #surface {
    touch-action: pan-y pinch-zoom;
    padding: 3rem;
    background: lightblue;
  }
</style>
<div id="surface">pan-y pinch-zoom</div>
<pre id="result"></pre>
<script>
  const surface = document.getElementById('surface');
  document.getElementById('result').textContent =
    getComputedStyle(surface).touchAction;
</script>

Result

pan-y pinch-zoom

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources