scroll-initial-target

Experimental

A property that tells the browser to automatically 'snap' to a specific element when the page first loads or when a container first appears.

Quick example

.important-section {
  /* Keeps this section centered in view when the container loads */
  scroll-initial-target: nearest;
}

Quick facts

Initial value
none
Inherited
No
Applies to
all elements
Animation type
notAnimatable

Values

nonenearest

scroll-initial-target Browser Support

Limited availability 69% global usage

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

Not ready for production without a fallback.

133+
133+
ESC