:volume-locked
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The :volume-locked
CSS pseudo-class selector represents an element that is capable of making sound, such as <audio>
or <video>
, but the audio volume of the media element is currently "locked" by the user.
User agents may set media muted
or volume
values according to user preferences (e.g., remembering the last set value across sessions, on a per-site basis, or otherwise).
An element that is :volume-locked
cannot be muted, un-muted, or have its volume changed via JavaScript. The locked status is an operating system or user agent preference.
Syntax
:volume-locked {
/* ... */
}
Examples
CSS
:volume-locked {
border: 5px solid green;
}
video:volume-locked {
border: 5px solid aqua;
}
Specifications
Specification |
---|
Selectors Level 4 # selectordef-volume-locked |
HTML # selector-volume-locked |
Browser compatibility
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
:volume-locked |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
See also
:buffering
:muted
:paused
:playing
:seeking
:stalled
- CSS selectors
volume
property ofHTMLMediaElement
objects