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.

.important-section {
  /* Keeps this section centered in view when the container loads */
  scroll-initial-target: nearest;
}
Initial value
none
Inherited
No
Applies to
allElements
Animation type
notAnimatable

Values

nonenearest
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