scroll-snap-align
Quick Summary for scroll-snap-align
The scroll-snap-align property specifies the box's snap position as an alignment of its snap area (as the alignment subject) within its snap container's snapport (as the alignment container). The two values specify the snapping alignment in the block axis and inline axis, respectively. If only one value is specified, the second value defaults to the same value.
Code Usage for scroll-snap-align
/* Keyword values */ scroll-snap-align: none; scroll-snap-align: start end; /* when two values set first is block, second inline */ scroll-snap-align: center;  /* Global values */ scroll-snap-align: inherit; scroll-snap-align: initial; scroll-snap-align: revert; scroll-snap-align: unset; 
More Details for scroll-snap-align

scroll-snap-align

The scroll-snap-align property specifies the box's snap position as an alignment of its snap area (as the alignment subject) within its snap container's snapport (as the alignment container). The two values specify the snapping alignment in the block axis and inline axis, respectively. If only one value is specified, the second value defaults to the same value.

Syntax

/* Keyword values */ scroll-snap-align: none; scroll-snap-align: start end; /* when two values set first is block, second inline */ scroll-snap-align: center;  /* Global values */ scroll-snap-align: inherit; scroll-snap-align: initial; scroll-snap-align: revert; scroll-snap-align: unset; 

Values

none

The box does not define a snap position in that axis.

start

The start alignment of this box's scroll snap area, within the scroll container's snapport is a snap position in this axis.

end

The end alignment of this box's scroll snap area, within the scroll container's snapport is a snap position in this axis.

center

The center alignment of this box's scroll snap area, within the scroll container's snapport is a snap position in this axis.

Safari currently has the two value syntax in the wrong order, the first value being inline the second block. See bug #191865.

Formal definition

Initial valuenone
Applies toall elements
Inheritedno
Computed valueas specified
Animation typediscrete

Formal syntax

[ none | start | end | center ]{1,2}

Specifications

Specification
CSS Scroll Snap Module Level 1 # scroll-snap-align

See also

CSS Scroll Snap Well-Controlled Scrolling with CSS Scroll Snap

No Items Found.

Add Comment
Type in a Nick Name here
 
Other Categories in CSS
css
Search CSS
Search CSS by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote
A person who never made a mistake never tried anything new.
Albert Einstein
Random CSS Property

radial-gradient()

The radial-gradient() CSS function creates an image consisting of a progressive transition between two or more colors that radiate from an origin. Its shape may be a circle or an ellipse. The function's result is an object of the <gradient> data type, which is a special kind of <image>.
radial-gradient() css reference