:target-after

An experimental pseudo-class that matches a 'scroll marker' when it represents an item that comes AFTER the current viewport in a scroll container.

This is an experimental technology. The syntax and behavior are still subject to change.

/* Usage Example */
.carousel::scroll-marker:target-after {
  /* Adds an indicator or fades out markers for items the user hasn't seen yet */
  opacity: 0.2;
}
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+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC