Interactivity & scrolling

The properties that shape how people interact with a page: the pointer, text selection, form controls and the text caret, focus reading order and speech, then how scroll containers behave, how their scrollbars look, where scrolling comes to rest and the generated parts of a CSS carousel. Whether a box scrolls at all is set by overflow, under Box model; every other property group is listed on the Properties overview.

Pointer & cursor

cursor

The mouse cursor shown while the pointer is over the element. Use it to hint at what a click or drag will do.

Syntax[<cursor-image>,]* <cursor-predefined>
Initialauto
Applies toAll elements
InheritedYes
AnimationDiscrete
SupportChrome 1 · Firefox 1 · Safari 1.2
Speccss-ui-4
ValueMeaning
autoThe browser chooses from the context, for example a text cursor over selectable text.
defaultThe platform's default cursor, usually an arrow.
noneNo cursor is shown.
pointerA link or other clickable thing, usually a pointing hand.
context-menu, helpA context menu, or help, is available.
progressThe program is busy in the background but can still be used.
waitThe program is busy and the user should wait.
cell, crosshairA table cell can be selected; a precise point can be picked.
text, vertical-textText can be selected, in horizontal or vertical lines.
alias, copy, moveDropping here will create a shortcut, a copy, or move the item.
no-drop, not-allowedThe dragged item cannot be dropped here; the action is not allowed.
grab, grabbingSomething can be grabbed and dragged; it is being dragged.
n-resize, e-resize, s-resize, w-resize, ne-resize, nw-resize, se-resize, sw-resizeAn edge or corner can be moved in that compass direction.
ew-resize, ns-resize, nesw-resize, nwse-resizeResizing in both directions along one line.
col-resize, row-resizeA column or row can be resized.
all-scrollThe content can be scrolled in any direction.
zoom-in, zoom-outSomething can be zoomed in or out.

Custom cursors come first as a comma-separated list of images, each optionally followed by the x and y of its hotspot. A keyword must always come last as the fallback.

cursor: url(pen.svg) 2 30, crosshair;
A custom cursor whose hotspot is near its bottom-left corner, falling back to a crosshair.

pointer-events

Whether an element can be the target of pointer events such as clicks and hovers. With none, the pointer passes through to whatever is underneath.

Syntaxauto | bounding-box | visiblePainted | visibleFill | visibleStroke | visible | painted | fill | stroke | all | none
Initialauto
Applies toContainer elements, graphics elements and use (in SVG); all elements in HTML
InheritedYes
AnimationDiscrete
SupportChrome 1 · Firefox 1.5 · Safari 4
SpecSVG 2

On HTML elements only auto and none matter. The other values are for SVG, where they choose whether the fill, the stroke or the bounding box receives events, and whether it must be visible. A descendant can set pointer-events: auto to take events again inside a parent set to none.

touch-action

Which touch gestures the browser handles itself on an element, such as panning and pinch-zooming. Gestures it does not handle go to the page's pointer event handlers instead, which is what a custom drawing surface, map or slider needs.

Syntaxauto | none | [ [ pan-x | pan-left | pan-right ] || [ pan-y | pan-up | pan-down ] || pinch-zoom ] | manipulation
Initialauto
Applies toAll elements except non-replaced inline elements, table rows, row groups, table columns and column groups
InheritedNo
AnimationNot animatable
SupportChrome 36 · Firefox 52 · Safari 13
Speccompat
ValueEffect
autoThe browser handles every gesture as usual.
noneThe browser handles no touch gestures; all of them reach the page's handlers.
pan-xHorizontal panning is allowed.
pan-yVertical panning is allowed.
pinch-zoomZooming with more than one finger is allowed.
manipulationPanning and pinch-zoom are allowed, but not other gestures such as double-tap to zoom.

The values combine: pan-y pinch-zoom lets the page scroll vertically and zoom while a script handles horizontal swipes. pan-left, pan-right, pan-up and pan-down allow panning in one direction only, and are supported in Chrome only (from 55). pinch-zoom arrived later than the property itself: Chrome 56, Firefox 85, Safari 13.

user-select

Controls whether the user can select the element's text. none prevents selection, all selects the whole element in one go, and contain keeps a selection that starts inside from extending outside.

Syntaxauto | text | none | contain | all
Initialauto
Applies toAll elements, and optionally the ::before and ::after pseudo-elements
InheritedNo
AnimationDiscrete
SupportChrome 54 · Firefox 69 · Safari no
Speccss-ui-4

Safari supports it only with the prefix, as -webkit-user-select.

Form controls & caret

appearance

Whether a form control is drawn with the platform's native look. none strips the native styling so the control can be styled like any other box; auto keeps it.

Syntaxnone | auto | base | base-select | <compat-auto> | <compat-special>
Initialnone
Applies toAll elements
InheritedNo
AnimationDiscrete
SupportChrome 84 · Firefox 80 · Safari 15.4
Speccss-ui-4

base-select on a <select> and its ::picker(select) switches it to a fully stylable, customisable select (Chrome 135, Safari 27). The <compat-auto> keywords (button, checkbox, menulist and so on) are legacy values that behave like auto; of the <compat-special> keywords, textfield removes a search field's native styling and menulist-button draws a select as a drop-down button.

accent-color

The accent colour of native form controls such as checkboxes, radio buttons, range sliders and progress bars, so they match a brand without being rebuilt.

Syntaxauto | <color>
Initialauto
Applies toAll elements
InheritedYes
AnimationBy computed value type
SupportChrome 93 · Firefox 92 · Safari 26.2
Speccss-ui-4

Safari 15.4 to 26.1 applied the colour but did not keep the control's contrast legible.

field-sizing

With content, a form control such as a text input, <textarea> or <select> sizes itself to fit what is in it, growing as the user types, instead of keeping a fixed default size.

Syntaxfixed | content
Initialfixed
Applies toElements with a default preferred size
InheritedNo
AnimationDiscrete
SupportChrome 123 · Firefox 152 · Safari 26.2
Speccss-forms-1
textarea { field-sizing: content; min-block-size: 3lh; max-block-size: 12lh; }
A textarea that grows with its text between three and twelve lines.

caret-color

The colour of the text insertion caret in inputs, textareas and editable content. auto usually follows currentColor.

Syntaxauto | <color> [auto | <color>]?
Initialauto
Applies toText or elements that accept text input
InheritedYes
AnimationBy computed value
SupportChrome 57 · Firefox 53 · Safari 11.1
Speccss-ui-4

caret-shape

The shape of the text caret: a thin vertical bar, a block covering the next character, or an underscore beneath it. auto uses the platform's usual caret.

Syntaxauto | bar | block | underscore
Initialauto
Applies toText or elements that accept text input
InheritedYes
AnimationBy computed value
SupportChrome 144 · Firefox no · Safari no
Speccss-ui-4

caret-animation

With manual, the browser stops blinking the caret, so an author's own animation of caret-color is not fighting the built-in blink. auto keeps the usual blink.

Syntaxauto | manual
Initialauto
Applies toText or elements that accept text input
InheritedYes
AnimationDiscrete
SupportChrome 140 · Firefox no · Safari no
Speccss-ui-4

resize

Gives the element a handle the user can drag to resize it, in both axes, or only horizontally or vertically. Textareas are resizable by default; other elements need overflow set to something other than visible first.

Syntaxnone | both | horizontal | vertical | block | inline
Initialnone
Applies toScroll containers, and optionally replaced elements such as images, videos and iframes
InheritedNo
AnimationDiscrete
SupportChrome 1 · Firefox 4 · Safari 3
Speccss-ui-4

Interaction

interactivity

With inert, the element and its descendants become inert: they cannot be focused, clicked or selected and are hidden from assistive technology, just as with the HTML inert attribute, but set from a stylesheet.

Syntaxauto | inert
Initialauto
Applies toAll elements
InheritedYes
AnimationDiscrete
SupportChrome 135 · Firefox no · Safari no
Speccss-ui-4

interest-delay

Shorthand for interest-delay-start and interest-delay-end: how long the user must hover over or focus an interest invoker (an element with the interestfor attribute) before its target shows, and how long after they move away before it hides. One value sets both.

Syntax<'interest-delay-start'>{1,2}
InitialSee individual properties
Applies toSee individual properties
InheritedSee individual properties
AnimationSee individual properties
SupportChrome 142 · Firefox no · Safari no
Speccss-ui-4
[interestfor] { interest-delay: 300ms 600ms; }
Show the target after 300ms of hover or focus, and hide it 600ms after the user moves away.

interest-delay-start, interest-delay-end

The delay before interest is gained (start) or lost (end). normal uses the browser's default delay.

Syntaxnormal | <time>
Initialnormal
Applies toAll elements
InheritedYes
AnimationBy computed value type
SupportChrome 142 · Firefox no · Safari no
Speccss-ui-4

reading-flow

Makes keyboard focus order and the order read by assistive technology follow a flex or grid container's visual layout instead of the source order, so reordered items are no longer reached out of sequence.

Syntaxnormal | source-order | flex-visual | flex-flow | grid-rows | grid-columns | grid-order
Initialnormal
Applies toBlock, flex and grid containers
InheritedNo
AnimationNot animatable
SupportChrome 137 · Firefox no · Safari no
Speccss-display-4
ValueReading order
normalSource order, as usual.
flex-visualFlex items in visual reading order, taking the writing mode into account.
flex-flowFlex items in the order given by flex-flow.
grid-rows, grid-columnsGrid items in visual order, row by row or column by column.
grid-orderGrid items in source order as changed by the order property.
source-orderSource order, but items can be moved with reading-order.

reading-order

Moves an item within its container's reading flow: items are read and focused in ascending reading-order, with ties falling back to the container's reading flow.

Syntax<integer>
Initial0
Applies toDirect block-level, grid item or flex item children of a reading flow container
InheritedNo
AnimationBy computed value type
SupportChrome 137 · Firefox no · Safari no
Speccss-display-4

window-drag

With move, dragging the element moves the browser window. It is for installed web apps that draw their own title bar.

Syntaxnone | move
Initialnone
Applies toAll elements
InheritedYes
AnimationDiscrete
SupportChrome 152 · Firefox no · Safari no
Speccss-ui-4

Speech

speak

Whether the element's text is spoken by a speech synthesiser. never silences it, always speaks it even when it is not displayed, and auto follows whether it is rendered.

Syntaxauto | never | always
Initialauto
Applies toAll elements
InheritedYes
AnimationDiscrete
SupportChrome ≤80 · Firefox no · Safari no
Speccss-speech-1

Chrome's implementation does not fully follow the specification.

speak-as

How text is read aloud: spell-out reads it letter by letter, digits reads numbers one digit at a time, and literal-punctuation or no-punctuation reads punctuation out or skips it.

Syntaxnormal | spell-out || digits || [ literal-punctuation | no-punctuation ]
Initialnormal
Applies toAll elements
InheritedYes
AnimationDiscrete
SupportChrome no · Firefox no · Safari 11.1
Speccss-speech-1

Scrolling behaviour

scroll-behavior

With smooth, scrolls triggered by navigation to a fragment or by script animate smoothly instead of jumping. Scrolling done by the user is not affected.

Syntaxauto | smooth
Initialauto
Applies toScroll containers
InheritedNo
AnimationNot animatable
SupportChrome 61 · Firefox 36 · Safari 15.4
Speccss-overflow-3
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
Smooth in-page jumps, only for people who have not asked for reduced motion.

overflow-anchor

Scroll anchoring keeps the visible content still when something above it changes size, such as an image loading. none opts an element, or a whole scroll container, out of being used as the anchor.

Syntaxauto | none
Initialauto
Applies toAll elements
InheritedNo
AnimationDiscrete
SupportChrome 56 · Firefox 66 · Safari 27
Speccss-scroll-anchoring-1

overscroll-behavior

Shorthand for overscroll-behavior-x and overscroll-behavior-y: what happens when the user scrolls past the end of a scroll container. One value sets both axes; two set x then y.

Syntax[ contain | none | auto | chain ]{1,2}
Initialauto auto
Applies toScroll container elements
InheritedNo
AnimationDiscrete
SupportChrome 144 · Firefox 150 · Safari 16
Speccss-overscroll-1
ValueEffect
autoScrolling carries on into the parent scroll container, and the platform's overscroll effects (bounce, pull to refresh) happen as usual.
containScrolling stops at this container and does not chain to the parent, but the container still shows its own overscroll effect.
noneNo scroll chaining and no overscroll effect.
chainScrolling chains to the parent even when this container has no scrollable overflow (Chrome 150, Firefox 157).

Earlier versions (Chrome 63, Firefox 59) supported the property except on scroll containers that had no scrollable overflow; Safari 16 still has that limit. overscroll-behavior: contain on a modal or side panel stops the page behind it from scrolling once the panel reaches its end.

overscroll-behavior-x, overscroll-behavior-y, overscroll-behavior-block, overscroll-behavior-inline

Overscroll handling in one axis: the two physical axes, or the block and inline axes of the writing mode.

Syntaxcontain | none | auto | chain
Initialauto
Applies toScroll container elements
InheritedNo
AnimationDiscrete
SupportChrome 144 · Firefox 150 · Safari 16
Speccss-overscroll-1

scroll-initial-target

With nearest, the element's nearest scroll container starts out scrolled to show it when the page first loads, for example to open a carousel on a middle slide.

Syntaxnone | nearest
Initialnone
Applies toAll elements
InheritedNo
AnimationNot animatable
SupportChrome 133 · Firefox no · Safari no
Speccss-scroll-snap-2

scroll-axis-lock

Whether the browser may lock a user's scroll gesture to a single axis. With none, a diagonal swipe can scroll in both directions at once.

Syntaxauto | none
Initialauto
Applies toScroll container elements
InheritedNo
AnimationDiscrete
SupportChrome 153 · Firefox no · Safari no
Speccss-overflow-5

Scrollbars

scrollbar-color

The colours of a scroll container's scrollbars: the thumb first, then the track. auto uses the platform's colours.

Syntaxauto | <color>{2}
Initialauto
Applies toScroll containers
InheritedYes
AnimationBy computed value
SupportChrome 121 · Firefox 64 · Safari 26.2
Speccss-scrollbars-1
scrollbar-color: oklch(60% 0.1 250) transparent;
A tinted thumb on a see-through track.

scrollbar-width

How thick the scrollbars are: the platform default, a thin variant, or none to hide them while leaving the box scrollable.

Syntaxauto | thin | none
Initialauto
Applies toScroll containers
InheritedNo
AnimationDiscrete
SupportChrome 121 · Firefox 64 · Safari 18.2
Speccss-scrollbars-1

scrollbar-gutter

With stable, space for a classic scrollbar is always reserved, so the content does not shift sideways when the scrollbar appears or disappears. both-edges reserves the same space on the opposite side too, keeping content centred.

Syntaxauto | stable && both-edges?
Initialauto
Applies toScroll containers
InheritedNo
AnimationDiscrete
SupportChrome 94 · Firefox 97 · Safari 18.2
Speccss-overflow-3

Overlay scrollbars, which float over the content, never take up a gutter, so the property has no effect on them.

Scroll snap

scroll-snap-type

Turns a scroll container into a snap container: after the user scrolls, it comes to rest aligned to one of its children's snap positions. The first keyword picks the axis; mandatory always snaps, while proximity (the default) snaps only when a snap position is close.

Syntaxnone | [ x | y | block | inline | both | pair ] [ mandatory | proximity ]?
Initialnone
Applies toScroll containers
InheritedNo
AnimationDiscrete
SupportChrome 69 · Firefox 99 · Safari 11
Speccss-scroll-snap-1
.carousel {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.carousel > * {
  scroll-snap-align: center;
  scroll-snap-stop: always; /* never skip past a slide */
}
A horizontal carousel that always settles with one slide centred.

Snap positions are set on the children with scroll-snap-align. pair, which snaps in both axes together to a single position, is in Chrome 156 only.

scroll-snap-align

Where an element sits in the snapport when its scroll container snaps to it: aligned to the start, end or center. One value sets both axes; two set the block axis then the inline axis.

Syntax[ none | start | end | center ]{1,2}
Initialnone
Applies toAll elements
InheritedNo
AnimationDiscrete
SupportChrome 69 · Firefox 68 · Safari 11
Speccss-scroll-snap-1

scroll-snap-stop

With always, a fast scroll must stop at this element's snap position rather than flying past it to a later one. normal allows skipping.

Syntaxnormal | always
Initialnormal
Applies toAll elements
InheritedNo
AnimationDiscrete
SupportChrome 75 · Firefox 103 · Safari 15
Speccss-scroll-snap-1

Scroll margin & padding

scroll-margin

Shorthand for the four physical scroll margins: extra space around an element that is kept in view when it is scrolled to, whether by snapping, a fragment link or scrollIntoView(). Takes one to four values in the same order as margin. It does not affect layout.

Syntax<length>{1,4}
Initial0
Applies toAll elements
InheritedNo
AnimationBy computed value type
SupportChrome 69 · Firefox 90 · Safari 14.1
Speccss-scroll-snap-1
h2[id] { scroll-margin-block-start: 5rem; }
Headings reached by a fragment link stop clear of a 5rem sticky header.

scroll-margin-block, scroll-margin-inline

Shorthands for the start and end scroll margins in the block or inline axis. One value sets both ends; two set start then end.

Syntax<length>{1,2}
Initial0
Applies toAll elements
InheritedNo
AnimationBy computed value type
SupportChrome 69 · Firefox 68 · Safari 15
Speccss-scroll-snap-1

scroll-margin-top, scroll-margin-right, scroll-margin-bottom, scroll-margin-left

The scroll margin on one physical side of the element.

Syntax<length>
Initial0
Applies toAll elements
InheritedNo
AnimationBy computed value type
SupportChrome 69 · Firefox 68 · Safari 14.1
Speccss-scroll-snap-1

scroll-margin-block-start, scroll-margin-block-end, scroll-margin-inline-start, scroll-margin-inline-end

The scroll margin on one flow-relative side, mapped to a physical side by the writing mode and direction.

Syntax<length>
Initial0
Applies toAll elements
InheritedNo
AnimationBy computed value type
SupportChrome 69 · Firefox 68 · Safari 15
Speccss-scroll-snap-1

scroll-padding

Shorthand for the four physical scroll paddings: an inset on the scroll container that shrinks the area used when scrolling things into view, for example to keep snapped or linked content out from under a sticky header. Takes one to four values in the same order as padding. It does not affect layout.

Syntax[ auto | <length-percentage [0,∞]> ]{1,4}
Initialauto
Applies toScroll containers
InheritedNo
PercentagesRelative to the corresponding dimension of the scroll container's scrollport
AnimationBy computed value type
SupportChrome 69 · Firefox 68 · Safari 14.1
Speccss-scroll-snap-1
html { scroll-padding-block-start: 4rem; }
Every in-page jump on the document leaves room for a 4rem fixed header.

scroll-padding-block, scroll-padding-inline

Shorthands for the start and end scroll paddings in the block or inline axis. One value sets both ends; two set start then end.

Syntax[ auto | <length-percentage [0,∞]> ]{1,2}
Initialauto
Applies toScroll containers
InheritedNo
PercentagesRelative to the scroll container's scrollport
AnimationBy computed value
SupportChrome 69 · Firefox 68 · Safari 15
Speccss-scroll-snap-1

scroll-padding-top, scroll-padding-right, scroll-padding-bottom, scroll-padding-left

The scroll padding on one physical side of the scroll container. auto lets the browser choose, which is usually 0.

Syntaxauto | <length-percentage [0,∞]>
Initialauto
Applies toScroll containers
InheritedNo
PercentagesRelative to the scroll container's scrollport
AnimationBy computed value type
SupportChrome 69 · Firefox 68 · Safari 14.1
Speccss-scroll-snap-1

scroll-padding-block-start, scroll-padding-block-end, scroll-padding-inline-start, scroll-padding-inline-end

The scroll padding on one flow-relative side of the scroll container, mapped to a physical side by the writing mode and direction.

Syntaxauto | <length-percentage [0,∞]>
Initialauto
Applies toScroll containers
InheritedNo
PercentagesRelative to the scroll container's scrollport
AnimationBy computed value type
SupportChrome 69 · Firefox 68 · Safari 15
Speccss-scroll-snap-1

Carousel parts

scroll-marker-group

Makes a scroll container generate a ::scroll-marker-group pseudo-element, placed before or after it, which holds the ::scroll-marker of each item: a row of dots or tabs that jump to the item and show which one is in view.

Syntaxnone | [ [ before | after ] || [ links | tabs ] ]
Initialnone
Applies toScroll containers
InheritedNo
AnimationDiscrete
SupportChrome 135 · Firefox no · Safari no
Speccss-overflow-5
.carousel { scroll-marker-group: after; }
.carousel > li::scroll-marker { content: ''; }
.carousel > li::scroll-marker:target-current { background: currentColor; }
A dot under the carousel for each slide, filled in for the slide in view.

scroll-target-group

With auto, the element becomes a group of ordinary anchor links whose targets are tracked as the page scrolls; the link whose target is in view matches :target-current. Use it to highlight the current section in a table of contents.

Syntaxnone | auto
Initialnone
Applies toAll elements
InheritedNo
AnimationDiscrete
SupportChrome 140 · Firefox no · Safari no
Speccss-overflow-5