`::view-transition-image-pair()` CSS pseudo-element
Baseline Newly available
This feature works across the latest devices and browser versions. This feature might not work in older devices or browser versions. It's been available across browsers since October 2025.
The ::view-transition-image-pair() CSS pseudo-element represents a container for a view transition's "old" and "new" view states — before and after the transition.
During a view transition, ::view-transition-image-pair() is included in the associated pseudo-element tree as explained in The view transition pseudo-element tree. It is only ever a child of a ::view-transition-group(). In terms of children, it can have a ::view-transition-new() or a ::view-transition-old(), or both.
::view-transition-image-pair() is given the following default styling in the UA stylesheet:
:root::view-transition-image-pair(*) {
position: absolute;
inset: 0;
animation-duration: inherit;
animation-fill-mode: inherit;
animation-delay: inherit;
}
During a view transition, ::view-transition-image-pair() has isolation: isolate set on it in the view transition style sheet so that its children can be blended with non-normal blend modes without affecting other visual outputs.
Syntax
::view-transition-image-pair([ <pt-name-selector> <pt-class-selector>? ] | <pt-class-selector>) {
/* ... */
}
Parameters
-
* - The universal selector (
*); selects all view transition groups on a page. -
root - Causes the pseudo-element to match the default
rootview transition snapshot group created by the user agent to contain the view transition for the overall page. This group includes any element not assigned to its own specific view transition snapshot group via theview-transition-nameproperty. -
<pt-name-selector> - The
<custom-ident>set as the value of theview-transition-nameproperty. -
<pt-class-selector> - The
<custom-ident>set as the value of theview-transition-classproperty preceded by a period (.).
Examples
::view-transition-image-pair(root) {
isolation: auto;
}
::view-transition-image-pair(.card) {
isolation: isolate;
}
Specifications
Browser compatibility
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on iOS | Samsung Internet | WebView Android | WebView on iOS | |
view-transition-image-pair |
109 |
109 |
144 |
95 |
18 |
109 |
144 |
74 |
18 |
21.0 |
109 |
18 |
See also
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/::view-transition-image-pair