🍋
Menu
CSS

Scroll Snap

CSS Scroll Snap

Properties that control scroll position snapping, ensuring elements align to defined snap points after scrolling.

Техническая деталь

CSS scroll snap is part of the CSS specification maintained by the W3C CSS Working Group. Browser rendering engines (Blink, WebKit, Gecko) implement the specification through their layout and paint pipeline stages. Understanding the rendering pipeline — Style → Layout → Paint → Composite — is key to writing performant CSS. Properties that trigger layout recalculation (width, height, margin) are more expensive than those that only trigger compositing (transform, opacity).

Пример

```css
/* Example: Scroll Snap */
.element {
  /* Apply scroll snap to this element */
  display: block;
  margin: 0 auto;
}
```

Связанные инструменты

Связанные термины