:target-current

An experimental pseudo-class that matches the 'scroll marker' corresponding to the item currently visible in the viewport. This is the 'active' state for carousel indicators.

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

/* Usage Example */
.carousel::scroll-marker:target-current {
  /* Highlights the indicator for the currently visible slide */
  background-color: var(--brand-active);
  transform: scale(1.2);
}
Limited availability Since 2020 69% global usage

This feature is not Baseline because it does not work in some of the most widely-used browsers.

135+
135+
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