{{CSSRef}}{{SeeCompatTable}}
Summary
The scroll-snap-coordinate
CSS property defines the positions in x and y coordinates within the element which will align with the nearest ancestor scroll container's {{cssxref("scroll-snap-destination")}} for the respective axis.
If the element has been transformed, the snap coordinate is transformed in the same way in order to align the snap point with the element as it is displayed.
{{cssbox("scroll-snap-coordinate")}}
Syntax
/* Keyword value */ scroll-snap-coordinate: none; /* <position> values */ scroll-snap-coordinate: 50px 50px; /* Single coordinate */ scroll-snap-coordinate: 100px 100px, 100px bottom; /* Multiple coordinates */ /* Global values */ scroll-snap-coordinate: inherit; scroll-snap-coordinate: initial; scroll-snap-coordinate: unset;
Values
none
- Specifies that the element does not contribute to a snap point.
<position>
- Specifies the offset of the snap coordinates from the start edge of the element’s border box. For each pairing, the first value gives the x coordinate of the snap coordinate, the second value its y coordinate.
Formal syntax
{{csssyntax2}}
Specification
Specification | Status | Comment |
---|---|---|
{{SpecName("CSS Scroll Snap Points", "#propdef-scroll-snap-coordinate", "scroll-snap-coordinate")}} | {{Spec2("CSS Scroll Snap Points")}} | Initial definition |
Browser compatibility
{{ CompatibilityTable() }}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | {{CompatUnknown}} | {{CompatGeckoDesktop("39.0")}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |
Feature | Android | Firefox Mobile (Gecko) | Firefox OS | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | {{CompatNo}} | {{CompatGeckoMobile("39.0") }}[1] | {{CompatGeckoMobile("39.0") }} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |
[1] On Firefox Mobile, available since Gecko 39, but behind the preference layout.css.vertical-text.enabled
, disabled by default.
See also
- {{CSS_Reference:Scroll_Snap_Point_Properties}}