:target-before
An experimental pseudo-class that matches a 'scroll marker' when it represents an item that comes BEFORE the current viewport in a scroll container.
This is an experimental technology. The syntax and behavior are still subject to change.
Syntax
/* Usage Example */
.carousel::scroll-marker:target-before {
/* Adds an indicator or fades out markers for items the user has already scrolled past */
opacity: 0.2;
}
:target-before Browser support
Limited availability
Since
2020 62% global usage
This feature is not Baseline because it does not work in some of the most widely-used browsers.
142+
142+