CKTIS / CSS
WebKit number input spin-button pseudo-elements
`::-webkit-inner-spin-button` styles the inner spin control of a number input in supporting browsers. `::-webkit-outer-spin-button` targeted a separate control in a historical WebKit implementation. Neither selector is standard or portable.
Version: Non-standard WebKit-prefixed CSS pseudo-elements. The outer selector is documented here for the historical WebKit implementation bundled with Qt 4.8; this does not establish support in current browsers.
Syntax
input[type="number"]::-webkit-outer-spin-button { /* declarations */ }
input[type="number"]::-webkit-inner-spin-button { /* declarations */ }::-webkit-inner-spin-button is a non-standard CSS pseudo-element for styling the inner control that increments and decrements an input[type="number"]. It does not select the whole input or an element the author added to the document. MDN demonstrates its use in WebKit- and Blink-based browsers; do not assume support across browsers.
In the historical WebKit implementation bundled with Qt 4.8, ::-webkit-outer-spin-button matched a separate outer spin control when the engine created one. That implementation's input code and default stylesheet distinguish the outer control from the inner one. The outer selector is not an alias of ::-webkit-inner-spin-button and does not select the outside edge of the same control. A browser can accept the selector's syntax without matching anything. The historical implementation does not establish support in current browsers.
The example sets cursor: pointer in separate rules without hiding the buttons. The input starts at 3, and one increment changes it to 4. If the inner control is visible and the browser applies the declaration to it, hovering over it shows a pointer cursor. The outer rule is not guaranteed to have a visible effect. To compare behavior across browsers, disable the rules one at a time. Native controls' appearance and visibility depend on the browser and platform. Treat these styles as an optional enhancement, not a requirement for operating the form.
Examples
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>Number spinner cursor</title>
<style>
#quantity { width: 8rem; }
#quantity::-webkit-outer-spin-button {
cursor: pointer;
}
#quantity::-webkit-inner-spin-button {
cursor: pointer;
}
</style>
<label for="quantity">Quantity</label>
<input id="quantity" type="number" min="0" max="10" step="1" value="3">
</html>Result
Initially: Quantity and a number input containing 3. Where the inner spin control is rendered and the styling is supported, hovering over it shows a pointer cursor. One increment changes 3 to 4. No visible effect is guaranteed for the outer selector.
The code and stated result were verified in an isolated environment. This does not establish that `::-webkit-outer-spin-button` matches a control.