-
Notifications
You must be signed in to change notification settings - Fork 790
Expand file tree
/
Copy pathOverview.html
More file actions
1517 lines (1504 loc) · 133 KB
/
Overview.html
File metadata and controls
1517 lines (1504 loc) · 133 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html><html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>CSS Scroll Snap Module Level 1</title>
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
<meta content="exploring" name="csswg-work-status">
<meta content="ED" name="w3c-status">
<link href="../default.css" rel="stylesheet" type="text/css">
<link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
<style>
body {
background-image: url("https://www.w3.org/StyleSheets/TR/logo-ED");
};
</style>
<meta content="Bikeshed 1.0.0" name="generator">
<style>/* style-md-lists */
/* This is a weird hack for me not yet following the commonmark spec
regarding paragraph and lists. */
[data-md] > :first-child {
margin-top: 0;
}
[data-md] > :last-child {
margin-bottom: 0;
}</style>
<style>/* style-selflinks */
.heading, .issue, .note, .example, li, dt {
position: relative;
}
a.self-link {
position: absolute;
top: 0;
left: calc(-1 * (3.5rem - 26px));
width: calc(3.5rem - 26px);
height: 2em;
text-align: center;
border: none;
transition: opacity .2s;
opacity: .5;
}
a.self-link:hover {
opacity: 1;
}
.heading > a.self-link {
font-size: 83%;
}
li > a.self-link {
left: calc(-1 * (3.5rem - 26px) - 2em);
}
dfn > a.self-link {
top: auto;
left: auto;
opacity: 0;
width: 1.5em;
height: 1.5em;
background: gray;
color: white;
font-style: normal;
transition: opacity .2s, background-color .2s, color .2s;
}
dfn:hover > a.self-link {
opacity: 1;
}
dfn > a.self-link:hover {
color: black;
}
a.self-link::before { content: "¶"; }
.heading > a.self-link::before { content: "§"; }
dfn > a.self-link::before { content: "#"; }</style>
<style>/* style-counters */
.issue:not(.no-marker)::before {
content: "Issue " counter(issue);
}
.example:not(.no-marker)::before {
content: "Example";
content: "Example " counter(example);
}
.invalid.example:not(.no-marker)::before,
.illegal.example:not(.no-marker)::before {
content: "Invalid Example";
content: "Invalid Example" counter(example);
}</style>
<style>/* style-autolinks */
.css.css, .property.property, .descriptor.descriptor {
color: #005a9c;
font-size: inherit;
font-family: inherit;
}
.css::before, .property::before, .descriptor::before {
content: "‘";
}
.css::after, .property::after, .descriptor::after {
content: "’";
}
.property, .descriptor {
/* Don't wrap property and descriptor names */
white-space: nowrap;
}
.type { /* CSS value <type> */
font-style: italic;
}
pre .property::before, pre .property::after {
content: "";
}
[data-link-type="property"]::before,
[data-link-type="propdesc"]::before,
[data-link-type="descriptor"]::before,
[data-link-type="value"]::before,
[data-link-type="function"]::before,
[data-link-type="at-rule"]::before,
[data-link-type="selector"]::before,
[data-link-type="maybe"]::before {
content: "‘";
}
[data-link-type="property"]::after,
[data-link-type="propdesc"]::after,
[data-link-type="descriptor"]::after,
[data-link-type="value"]::after,
[data-link-type="function"]::after,
[data-link-type="at-rule"]::after,
[data-link-type="selector"]::after,
[data-link-type="maybe"]::after {
content: "’";
}
[data-link-type].production::before,
[data-link-type].production::after,
.prod [data-link-type]::before,
.prod [data-link-type]::after {
content: "";
}
[data-link-type=element],
[data-link-type=element-attr] {
font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;
font-size: .9em;
}
[data-link-type=element]::before { content: "<" }
[data-link-type=element]::after { content: ">" }
[data-link-type=biblio] {
white-space: pre;
}</style>
<style>/* style-dfn-panel */
.dfn-panel {
display: inline-block;
position: absolute;
z-index: 35;
height: auto;
width: -webkit-fit-content;
max-width: 300px;
max-height: 500px;
overflow: auto;
padding: 0.5em 0.75em;
font: small Helvetica Neue, sans-serif, Droid Sans Fallback;
background: #DDDDDD;
color: black;
border: outset 0.2em;
}
.dfn-panel:not(.on) { display: none; }
.dfn-panel * { margin: 0; padding: 0; text-indent: 0; }
.dfn-panel > b { display: block; }
.dfn-panel a { color: black; }
.dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; }
.dfn-panel > b + b { margin-top: 0.25em; }
.dfn-panel > span { display: list-item; list-style: inside; }
.dfn-panel.activated {
display: inline-block;
position: fixed;
left: .5em;
bottom: .5em;
margin: 0 auto;
max-width: calc(100vw - 1.5em - .4em - .5em);
max-height: 30vh;
}
.dfn-paneled { cursor: pointer; }
</style>
<style>/* style-syntax-highlighting */
.highlight .hll { background-color: #ffffcc }
.highlight { background: #ffffff; }
.highlight .c { color: #708090 } /* Comment */
.highlight .k { color: #990055 } /* Keyword */
.highlight .l { color: #000000 } /* Literal */
.highlight .n { color: #0077aa } /* Name */
.highlight .o { color: #999999 } /* Operator */
.highlight .p { color: #999999 } /* Punctuation */
.highlight .ch { color: #708090 } /* Comment.Hashbang */
.highlight .cm { color: #708090 } /* Comment.Multiline */
.highlight .cp { color: #708090 } /* Comment.Preproc */
.highlight .cpf { color: #708090 } /* Comment.PreprocFile */
.highlight .c1 { color: #708090 } /* Comment.Single */
.highlight .cs { color: #708090 } /* Comment.Special */
.highlight .kc { color: #990055 } /* Keyword.Constant */
.highlight .kd { color: #990055 } /* Keyword.Declaration */
.highlight .kn { color: #990055 } /* Keyword.Namespace */
.highlight .kp { color: #990055 } /* Keyword.Pseudo */
.highlight .kr { color: #990055 } /* Keyword.Reserved */
.highlight .kt { color: #990055 } /* Keyword.Type */
.highlight .ld { color: #000000 } /* Literal.Date */
.highlight .m { color: #000000 } /* Literal.Number */
.highlight .s { color: #a67f59 } /* Literal.String */
.highlight .na { color: #0077aa } /* Name.Attribute */
.highlight .nc { color: #0077aa } /* Name.Class */
.highlight .no { color: #0077aa } /* Name.Constant */
.highlight .nd { color: #0077aa } /* Name.Decorator */
.highlight .ni { color: #0077aa } /* Name.Entity */
.highlight .ne { color: #0077aa } /* Name.Exception */
.highlight .nf { color: #0077aa } /* Name.Function */
.highlight .nl { color: #0077aa } /* Name.Label */
.highlight .nn { color: #0077aa } /* Name.Namespace */
.highlight .py { color: #0077aa } /* Name.Property */
.highlight .nt { color: #669900 } /* Name.Tag */
.highlight .nv { color: #0077aa } /* Name.Variable */
.highlight .ow { color: #999999 } /* Operator.Word */
.highlight .mb { color: #000000 } /* Literal.Number.Bin */
.highlight .mf { color: #000000 } /* Literal.Number.Float */
.highlight .mh { color: #000000 } /* Literal.Number.Hex */
.highlight .mi { color: #000000 } /* Literal.Number.Integer */
.highlight .mo { color: #000000 } /* Literal.Number.Oct */
.highlight .sb { color: #a67f59 } /* Literal.String.Backtick */
.highlight .sc { color: #a67f59 } /* Literal.String.Char */
.highlight .sd { color: #a67f59 } /* Literal.String.Doc */
.highlight .s2 { color: #a67f59 } /* Literal.String.Double */
.highlight .se { color: #a67f59 } /* Literal.String.Escape */
.highlight .sh { color: #a67f59 } /* Literal.String.Heredoc */
.highlight .si { color: #a67f59 } /* Literal.String.Interpol */
.highlight .sx { color: #a67f59 } /* Literal.String.Other */
.highlight .sr { color: #a67f59 } /* Literal.String.Regex */
.highlight .s1 { color: #a67f59 } /* Literal.String.Single */
.highlight .ss { color: #a67f59 } /* Literal.String.Symbol */
.highlight .vc { color: #0077aa } /* Name.Variable.Class */
.highlight .vg { color: #0077aa } /* Name.Variable.Global */
.highlight .vi { color: #0077aa } /* Name.Variable.Instance */
.highlight .il { color: #000000 } /* Literal.Number.Integer.Long */
.highlight { background: hsl(24, 20%, 95%); }
code.highlight { padding: .1em; border-radius: .3em; }
pre.highlight, pre > code.highlight { display: block; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0; }
</style>
<body class="h-entry">
<div class="head">
<p data-fill-with="logo"><a class="logo" href="http://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C" width="72"> </a> </p>
<h1 class="p-name no-ref" id="title">CSS Scroll Snap Module Level 1</h1>
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="2016-05-10">10 May 2016</time></span></h2>
<div data-fill-with="spec-metadata">
<dl>
<dt>This version:
<dd><a class="u-url" href="https://drafts.csswg.org/css-snappoints/">https://drafts.csswg.org/css-snappoints/</a>
<dt>Latest published version:
<dd><a href="http://www.w3.org/TR/css-snappoints-1/">http://www.w3.org/TR/css-snappoints-1/</a>
<dt>Previous Versions:
<dd><a href="http://www.w3.org/TR/2015/WD-css-snappoints-1-20150326/" rel="previous">http://www.w3.org/TR/2015/WD-css-snappoints-1-20150326/</a>
<dt>Feedback:
<dd><span><a href="mailto:www-style@w3.org?subject=%5Bcss-snappoints%5D%20YOUR%20TOPIC%20HERE">www-style@w3.org</a> with subject line “<kbd>[css-snappoints] <i data-lt="">… message topic …</i></kbd>” (<a href="http://lists.w3.org/Archives/Public/www-style/" rel="discussion">archives</a>)</span>
<dt>Issue Tracking:
<dd><a href="#issues-index">Inline In Spec</a>
<dt class="editor">Editors:
<dd class="editor p-author h-card vcard"><span class="p-name fn">Matt Rakow</span> (<span class="p-org org">Microsoft</span>)
<dd class="editor p-author h-card vcard"><span class="p-name fn">Jacob Rossi</span> (<span class="p-org org">Microsoft</span>)
</dl>
</div>
<div data-fill-with="warning"></div>
<p class="copyright" data-fill-with="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2016 <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>). W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply. </p>
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
<div class="p-summary" data-fill-with="abstract">
<p>This module contains features to control panning and scrolling behavior with "snap positions".</p>
<a href="http://www.w3.org/TR/CSS/">CSS</a> is a language for describing the rendering of structured documents
(such as HTML and XML)
on screen, on paper, in speech, etc.
</div>
<h2 class="no-num no-toc no-ref heading settled" id="status"><span class="content">Status of this document</span></h2>
<div data-fill-with="status">
<p> This is a public copy of the editors’ draft.
It is provided for discussion only and may change at any moment.
Its publication here does not imply endorsement of its contents by W3C.
Don’t cite this document other than as work in progress. </p>
<p> The (<a href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public mailing list <a href="mailto:www-style@w3.org?Subject=%5Bcss-snappoints%5D%20PUT%20SUBJECT%20HERE">www-style@w3.org</a> (see <a href="http://www.w3.org/Mail/Request">instructions</a>)
is preferred for discussion of this specification.
When sending e-mail,
please put the text “css-snappoints” in the subject,
preferably like this:
“[css-snappoints] <em>…summary of comment…</em>” </p>
<p> This document was produced by the <a href="http://www.w3.org/Style/CSS/members">CSS Working Group</a> (part of the <a href="http://www.w3.org/Style/">Style Activity</a>). </p>
<p> This document was produced by a group operating under
the <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent Policy</a>.
W3C maintains a <a href="http://www.w3.org/2004/01/pp-impl/32061/status" rel="disclosure">public list of any patent disclosures</a> made in connection with the deliverables of the group;
that page also includes instructions for disclosing a patent.
An individual who has actual knowledge of a patent which the individual believes contains <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose the information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the W3C Patent Policy</a>. </p>
<p> This document is governed by the <a href="http://www.w3.org/2015/Process-20150901/" id="w3c_process_revision">1 September 2015 W3C Process Document</a>. </p>
<p></p>
</div>
<div data-fill-with="at-risk"></div>
<nav data-fill-with="table-of-contents" id="toc">
<h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
<ol class="toc" role="directory">
<li>
<a href="#intro"><span class="secno">1</span> <span class="content">Introduction</span></a>
<ol class="toc">
<li><a href="#placement"><span class="secno">1.1</span> <span class="content">Module interactions</span></a>
<li><a href="#values"><span class="secno">1.2</span> <span class="content">Values</span></a>
</ol>
<li><a href="#examples"><span class="secno">2</span> <span class="content">Motivating Examples</span></a>
<li><a href="#overview"><span class="secno">3</span> <span class="content">Overview</span></a>
<li><a href="#definitions"><span class="secno">4</span> <span class="content">Definitions</span></a>
<li>
<a href="#properties-on-the-scroll-container"><span class="secno">5</span> <span class="content">Capturing Scroll Snap Areas: Properties on the scroll container</span></a>
<ol class="toc">
<li><a href="#scroll-snap-type"><span class="secno">5.1</span> <span class="content">Scroll Snapping Rules: the <span class="property">scroll-snap-type</span> property</span></a>
<li><a href="#scroll-snap-padding"><span class="secno">5.2</span> <span class="content">Scroll Snapport: the <span class="property">scroll-snap-padding</span> property</span></a>
</ol>
<li>
<a href="#properties-on-the-elements"><span class="secno">6</span> <span class="content">Aligning Scroll Snap Areas: Properties on the elements</span></a>
<ol class="toc">
<li><a href="#scroll-snap-margin"><span class="secno">6.1</span> <span class="content">Scroll Snapping Area: the <span class="property">scroll-snap-margin</span> property</span></a>
<li><a href="#scroll-snap-align"><span class="secno">6.2</span> <span class="content">Scroll Snapping Alignment: the <span class="property">scroll-snap-align</span> property</span></a>
<li><a href="#snap-dimensions"><span class="secno">6.3</span> <span class="content">Axis vs Point-Snapping</span></a>
</ol>
<li>
<a href="#longhands"><span class="secno"></span> <span class="content">Appendix A: Longhands</span></a>
<ol class="toc">
<li><a href="#padding-longhands-physical"><span class="secno"></span> <span class="content">Physical Longhands for <span class="property">scroll-snap-padding</span></span></a>
<li><a href="#padding-longhands-logical"><span class="secno"></span> <span class="content">Flow-relative Longhands for <span class="property">scroll-snap-padding</span></span></a>
<li><a href="#margin-longhands-physical"><span class="secno"></span> <span class="content">Physical Longhands for <span class="property">scroll-snap-margin</span></span></a>
<li><a href="#margin-longhands-logical"><span class="secno"></span> <span class="content">Flow-relative Longhands for <span class="property">scroll-snap-margin</span></span></a>
</ol>
<li><a href="#priv-sec"><span class="secno">7</span> <span class="content">Privacy and Security Considerations</span></a>
<li><a href="#acknowledgements"><span class="secno">8</span> <span class="content">Acknowledgements</span></a>
<li>
<a href="#conformance"><span class="secno"></span> <span class="content"> Conformance</span></a>
<ol class="toc">
<li><a href="#document-conventions"><span class="secno"></span> <span class="content"> Document conventions</span></a>
<li><a href="#conform-classes"><span class="secno"></span> <span class="content"> Conformance classes</span></a>
<li>
<a href="#conform-responsible"><span class="secno"></span> <span class="content"> Requirements for Responsible Implementation of CSS</span></a>
<ol class="toc">
<li><a href="#conform-partial"><span class="secno"></span> <span class="content"> Partial Implementations</span></a>
<li><a href="#conform-future-proofing"><span class="secno"></span> <span class="content"> Implementations of Unstable and Proprietary Features</span></a>
<li><a href="#conform-testing"><span class="secno"></span> <span class="content"> Implementations of CR-level Features</span></a>
</ol>
</ol>
<li>
<a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
<ol class="toc">
<li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
<li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
</ol>
<li>
<a href="#references"><span class="secno"></span> <span class="content">References</span></a>
<ol class="toc">
<li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
</ol>
<li><a href="#property-index"><span class="secno"></span> <span class="content">Property Index</span></a>
<li><a href="#issues-index"><span class="secno"></span> <span class="content">Issues Index</span></a>
</ol>
</nav>
<main>
<p class="issue" id="issue-752e30a5"><a class="self-link" href="#issue-752e30a5"></a> <b>This spec is currently undergoing major changes in line with the resolutions in <a href="https://lists.w3.org/Archives/Public/www-style/2015Dec/0048.html">https://lists.w3.org/Archives/Public/www-style/2015Dec/0048.html</a>. During this process it is not safe to assume that the current form will be representative of what it will look like in the future. After the work in process is completed, it will closely resemble <a href="https://drafts.csswg.org/css-scroll-snap/">this proposal</a>.</b></p>
<h2 class="heading settled" data-level="1" id="intro"><span class="secno">1. </span><span class="content">Introduction</span><a class="self-link" href="#intro"></a></h2>
<p><em>This section is not normative.</em></p>
<p>Popular UX paradigms for scrollable content frequently employ paging through content,
or sectioning into logical divisions.
This is especially true for touch interactions
where it is quicker and easier for users to quickly pan through a flatly-arranged breadth of content
rather than delving into a heirarchical structure through tap navigation.
For example, it is easier for a user to view many photos in a photo album
by panning through a photo slideshow view
rather than tapping on individual photos in an album.</p>
<p>However, given the imprecise nature of scrolling inputs
like touch panning and mousewheel scrolling,
it is difficult for web developers to guarantee a well-controlled scrolling experience,
in particular creating the effect of paging through content.
For instance, it is easy for a user to land at an awkward scroll position
which leaves a page partially on-screen when panning.</p>
<p>To this end, we introduce scroll snap positions
which enforce the scroll positions that a <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-1">scroll container’s</a> scrollport may end at
after a scrolling operation has completed.</p>
<h3 class="heading settled" data-level="1.1" id="placement"><span class="secno">1.1. </span><span class="content">Module interactions</span><a class="self-link" href="#placement"></a></h3>
<p>This module extends the scrolling user interface features defined in <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a> section 11.1.</p>
<p>None of the properties in this module apply to the <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-pseudo-4/#selectordef-first-line">::first-line</a> and <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-pseudo-4/#selectordef-first-letter">::first-letter</a> pseudo-elements.</p>
<h3 class="heading settled" data-level="1.2" id="values"><span class="secno">1.2. </span><span class="content">Values</span><a class="self-link" href="#values"></a></h3>
<p>This specification follows the <a href="https://www.w3.org/TR/CSS21/about.html#property-defs">CSS property
definition conventions</a> from <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a>. Value types not defined in
this specification are defined in CSS Level 2 Revision 1 <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a>.
Other CSS modules may expand the definitions of these value types: for
example <a data-link-type="biblio" href="#biblio-css3val">[CSS3VAL]</a>, when combined with this module, expands the
definition of the <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" title="Expands to: em | advance measure | ch | vmin | cm | pc | pixel unit | in | rem | q | vh | ex | pt | vw | vmax | mm"><length></a> value type as used in this specification.</p>
<h2 class="heading settled" data-level="2" id="examples"><span class="secno">2. </span><span class="content">Motivating Examples</span><a class="self-link" href="#examples"></a></h2>
<div class="example" id="example-f1bcfb68">
<a class="self-link" href="#example-f1bcfb68"></a> In this example, a series of images arranged in a <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-2">scroll container</a> are used to build a photo gallery. In this example the <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-3">scroll container</a> is larger than the photos contained within (such that multiple images may be seen simultaneously), and the image
sizes vary. Using mandatory element-based snap
positions, scrolling will always complete with an image centered in the <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-4">scroll container’s</a> scrollport.
<pre class="lang-css highlight"><span></span><span class="nt">img </span><span class="p">{</span>
<span class="c">/* Specifies that the center of each photo </span>
<span class="c"> should align with the center of the scroll </span>
<span class="c"> container in the X axis when snapping */</span>
<span class="k">scroll-snap-align</span><span class="p">:</span> center none<span class="p">;</span>
<span class="p">}</span>
<span class="nt">.photoGallery </span><span class="p">{</span>
<span class="k">width</span><span class="p">:</span> <span class="m">500</span><span class="l">px</span><span class="p">;</span>
<span class="k">overflow-x</span><span class="p">:</span> auto<span class="p">;</span>
<span class="k">overflow-y</span><span class="p">:</span> hidden<span class="p">;</span>
<span class="k">white-space</span><span class="p">:</span> nowrap<span class="p">;</span>
<span class="c">/* Requires that the scroll position always be </span>
<span class="c"> at a snap position when the scrolling </span>
<span class="c"> operation completes. */</span>
<span class="k">scroll-snap-type</span><span class="p">:</span> mandatory<span class="p">;</span>
<span class="p">}</span></pre>
<pre class="lang-html highlight"><span></span><span class="p"><</span><span class="nt">div</span> <span class="na">class</span><span class="o">=</span><span class="s">"photoGallery"</span><span class="p">></span>
<span class="p"><</span><span class="nt">img</span> <span class="na">src</span><span class="o">=</span><span class="s">"img1.jpg"</span><span class="p">></span>
<span class="p"><</span><span class="nt">img</span> <span class="na">src</span><span class="o">=</span><span class="s">"img2.jpg"</span><span class="p">></span>
<span class="p"><</span><span class="nt">img</span> <span class="na">src</span><span class="o">=</span><span class="s">"img3.jpg"</span><span class="p">></span>
<span class="p"><</span><span class="nt">img</span> <span class="na">src</span><span class="o">=</span><span class="s">"img4.jpg"</span><span class="p">></span>
<span class="p"><</span><span class="nt">img</span> <span class="na">src</span><span class="o">=</span><span class="s">"img5.jpg"</span><span class="p">></span>
<span class="p"></</span><span class="nt">div</span><span class="p">></span></pre>
<figure>
<img alt="" src="element_snap_positions.png">
<figcaption> The layout of the scroll container’s contents in the example.
The snapport is represented by the red rectangle, and the snap area is represented by the yellow rectangle. Since the scroll-snap-align is "center" in the X axis, a snap position is established at each scroll position which aligns the X-center of the snapport (represented by a red dotted line) with the X-center of a snap area (represented by a yellow dotted line). </figcaption>
</figure>
</div>
<div class="example" id="example-e60ec52d">
<a class="self-link" href="#example-e60ec52d"></a> This example builds a paginated document that aligns each page near to (but not exactly on) the edge of the <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-5">scroll container</a>.
This allows the previous page to "peek" in from above in order to make the user aware that they are not yet at the top of the document.
Using proximity snap positions instead of mandatory snap positions allows the user to stop halfway through a page (rather than forcing them
to snap one page at a time). However, if a scrolling operation would finish near a snap position, then the scroll will be adjusted to
align the page as specified.
<pre class="lang-css highlight"><span></span><span class="nt">.page </span><span class="p">{</span>
<span class="c">/* Defines the top of each page as the</span>
<span class="c"> edge that should be used for snapping */</span>
<span class="k">scroll-snap-align</span><span class="p">:</span> none start<span class="p">;</span>
<span class="p">}</span>
<span class="nt">.docScroller </span><span class="p">{</span>
<span class="k">width</span><span class="p">:</span> <span class="m">500</span><span class="l">px</span><span class="p">;</span>
<span class="k">overflow-x</span><span class="p">:</span> hidden<span class="p">;</span>
<span class="k">overflow-y</span><span class="p">:</span> auto<span class="p">;</span>
<span class="c">/* Specifies that each element’s snap area should</span>
<span class="c"> align with a 100px offset from the top edge. */</span>
<span class="k">scroll-snap-padding</span><span class="p">:</span> <span class="m">100</span><span class="l">px</span> <span class="m">0</span> <span class="m">0</span><span class="p">;</span>
<span class="c">/* Encourages scrolling to end at a snap position when the</span>
<span class="c"> operation completes, if it is near a snap position */</span>
<span class="k">scroll-snap-type</span><span class="p">:</span> proximity<span class="p">;</span>
<span class="p">}</span></pre>
<pre class="lang-html highlight"><span></span><span class="p"><</span><span class="nt">div</span> <span class="na">class</span><span class="o">=</span><span class="s">"docScroller"</span><span class="p">></span>
<span class="p"><</span><span class="nt">div</span> <span class="na">class</span><span class="o">=</span><span class="s">"page"</span><span class="p">></span>Page 1<span class="p"></</span><span class="nt">div</span><span class="p">></span>
<span class="p"><</span><span class="nt">div</span> <span class="na">class</span><span class="o">=</span><span class="s">"page"</span><span class="p">></span>Page 2<span class="p"></</span><span class="nt">div</span><span class="p">></span>
<span class="p"><</span><span class="nt">div</span> <span class="na">class</span><span class="o">=</span><span class="s">"page"</span><span class="p">></span>Page 3<span class="p"></</span><span class="nt">div</span><span class="p">></span>
<span class="p"><</span><span class="nt">div</span> <span class="na">class</span><span class="o">=</span><span class="s">"page"</span><span class="p">></span>Page 4<span class="p"></</span><span class="nt">div</span><span class="p">></span>
<span class="p"></</span><span class="nt">div</span><span class="p">></span></pre>
<figure>
<img alt="" src="element_snap_positions_offset.png">
<figcaption> The layout of the scroll container’s contents in the example.
The snapport is represented by the red rectangle (inset from the top by 100px due to the scroll-snap-padding), and the snap area is represented by the yellow rectangle. Since the scroll-snap-align is "start" in the Y axis, a snap position is established at each scroll position which aligns the Y-start of the snapport (represented by a red dotted line) with the Y-start of a snap area (represented by a yellow dotted line). </figcaption>
</figure>
</div>
<h2 class="heading settled" data-level="3" id="overview"><span class="secno">3. </span><span class="content">Overview</span><a class="self-link" href="#overview"></a></h2>
<p>This module introduces control over <dfn class="dfn-paneled" data-dfn-type="dfn" data-local-lt="snap position" data-lt="scroll snap position" data-noexport="" id="scroll-snap-position">scroll snap positions<span class="dfn-panel" data-deco=""><b><a href="#scroll-snap-position">#scroll-snap-position</a></b><b>Referenced in:</b><span><a href="#ref-for-scroll-snap-position-1">3. Overview</a> <a href="#ref-for-scroll-snap-position-2">(2)</a> <a href="#ref-for-scroll-snap-position-3">(3)</a> <a href="#ref-for-scroll-snap-position-4">(4)</a> <a href="#ref-for-scroll-snap-position-5">(5)</a> <a href="#ref-for-scroll-snap-position-6">(6)</a> <a href="#ref-for-scroll-snap-position-7">(7)</a></span><span><a href="#ref-for-scroll-snap-position-8">5.1. Scroll Snapping Rules: the scroll-snap-type property</a> <a href="#ref-for-scroll-snap-position-9">(2)</a> <a href="#ref-for-scroll-snap-position-10">(3)</a> <a href="#ref-for-scroll-snap-position-11">(4)</a> <a href="#ref-for-scroll-snap-position-12">(5)</a> <a href="#ref-for-scroll-snap-position-13">(6)</a> <a href="#ref-for-scroll-snap-position-14">(7)</a> <a href="#ref-for-scroll-snap-position-15">(8)</a> <a href="#ref-for-scroll-snap-position-16">(9)</a> <a href="#ref-for-scroll-snap-position-17">(10)</a> <a href="#ref-for-scroll-snap-position-18">(11)</a> <a href="#ref-for-scroll-snap-position-19">(12)</a></span><span><a href="#ref-for-scroll-snap-position-20">5.2. Scroll Snapport: the scroll-snap-padding property</a></span><span><a href="#ref-for-scroll-snap-position-21">6.2. Scroll Snapping Alignment: the scroll-snap-align property</a> <a href="#ref-for-scroll-snap-position-22">(2)</a> <a href="#ref-for-scroll-snap-position-23">(3)</a> <a href="#ref-for-scroll-snap-position-24">(4)</a> <a href="#ref-for-scroll-snap-position-25">(5)</a></span><span><a href="#ref-for-scroll-snap-position-26">6.3. Axis vs Point-Snapping</a> <a href="#ref-for-scroll-snap-position-27">(2)</a> <a href="#ref-for-scroll-snap-position-28">(3)</a> <a href="#ref-for-scroll-snap-position-29">(4)</a></span></span></dfn>,
which are scroll positions that produce particular alignments
of content within a scroll container.
Using the <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-type" id="ref-for-propdef-scroll-snap-type-1">scroll-snap-type</a> property on the relevant <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-6">scroll container</a>,
the author can request a particular bias
for the scrollport to land on a <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-1">snap position</a> after scrolling operations.</p>
<p><a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-2">Snap positions</a> can be specified
as a particular alignment (<a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-align" id="ref-for-propdef-scroll-snap-align-1">scroll-snap-align</a>)
of an element’s <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-1">scroll snap area</a> (<a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin" id="ref-for-propdef-scroll-snap-margin-1">scroll-snap-margin</a>, defaulting to its border box)
within the <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-7">scroll container</a>’s <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-1">snapport</a> (its scrollport, as reduced by its <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding" id="ref-for-propdef-scroll-snap-padding-1">scroll-snap-padding</a>).
This is conceptually equivalent to specifying the alignment of
an <a data-link-type="dfn" href="https://drafts.csswg.org/css-align-3/#alignment-subject">alignment subject</a> within an <a data-link-type="dfn" href="https://drafts.csswg.org/css-align-3/#alignment-container">alignment container</a>.
A scroll position that satisfies the specified alignment
is a <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-3">snap position</a>.</p>
<p>The act of adjusting the scroll position
of a scroll container’s scrollport
such that it is aligned to a snap position
is called <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="snap | snapping | snapped" data-noexport="" id="snap">snapping<span class="dfn-panel" data-deco=""><b><a href="#snap">#snap</a></b><b>Referenced in:</b><span><a href="#ref-for-snap-1">3. Overview</a></span><span><a href="#ref-for-snap-2">5.1. Scroll Snapping Rules: the scroll-snap-type property</a> <a href="#ref-for-snap-3">(2)</a> <a href="#ref-for-snap-4">(3)</a> <a href="#ref-for-snap-5">(4)</a> <a href="#ref-for-snap-6">(5)</a> <a href="#ref-for-snap-7">(6)</a> <a href="#ref-for-snap-8">(7)</a> <a href="#ref-for-snap-9">(8)</a> <a href="#ref-for-snap-10">(9)</a></span></span></dfn>,
and a <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-8">scroll container</a> is said to be <a data-link-type="dfn" href="#snap" id="ref-for-snap-1">snapped</a> to a <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-4">snap position</a> if its scrollport’s scroll position
is that <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-5">snap position</a> and there is no active scrolling operation.
The CSS Scroll Snap Module
intentionally does not specify nor mandate
any precise animations or physics used to enforce <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-6">snap positions</a>;
this is left up to the user agent.</p>
<p><a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-7">Snap positions</a> only affect the nearest ancestor <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-9">scroll container</a> on the element’s <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#containing-block-chain">containing block chain</a>.</p>
<h2 class="heading settled" data-level="4" id="definitions"><span class="secno">4. </span><span class="content">Definitions</span><a class="self-link" href="#definitions"></a></h2>
<dl>
<dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export="" data-lt="scroll container" id="scroll-container">scroll container<span class="dfn-panel" data-deco=""><b><a href="#scroll-container">#scroll-container</a></b><b>Referenced in:</b><span><a href="#ref-for-scroll-container-1">1. Introduction</a></span><span><a href="#ref-for-scroll-container-2">2. Motivating Examples</a> <a href="#ref-for-scroll-container-3">(2)</a> <a href="#ref-for-scroll-container-4">(3)</a> <a href="#ref-for-scroll-container-5">(4)</a></span><span><a href="#ref-for-scroll-container-6">3. Overview</a> <a href="#ref-for-scroll-container-7">(2)</a> <a href="#ref-for-scroll-container-8">(3)</a> <a href="#ref-for-scroll-container-9">(4)</a></span><span><a href="#ref-for-scroll-container-10">5.1. Scroll Snapping Rules: the scroll-snap-type property</a> <a href="#ref-for-scroll-container-11">(2)</a> <a href="#ref-for-scroll-container-12">(3)</a> <a href="#ref-for-scroll-container-13">(4)</a> <a href="#ref-for-scroll-container-14">(5)</a> <a href="#ref-for-scroll-container-15">(6)</a> <a href="#ref-for-scroll-container-16">(7)</a> <a href="#ref-for-scroll-container-17">(8)</a> <a href="#ref-for-scroll-container-18">(9)</a> <a href="#ref-for-scroll-container-19">(10)</a> <a href="#ref-for-scroll-container-20">(11)</a> <a href="#ref-for-scroll-container-21">(12)</a> <a href="#ref-for-scroll-container-22">(13)</a> <a href="#ref-for-scroll-container-23">(14)</a> <a href="#ref-for-scroll-container-24">(15)</a> <a href="#ref-for-scroll-container-25">(16)</a> <a href="#ref-for-scroll-container-26">(17)</a> <a href="#ref-for-scroll-container-27">(18)</a> <a href="#ref-for-scroll-container-28">(19)</a> <a href="#ref-for-scroll-container-29">(20)</a> <a href="#ref-for-scroll-container-30">(21)</a> <a href="#ref-for-scroll-container-31">(22)</a></span><span><a href="#ref-for-scroll-container-32">5.2. Scroll Snapport: the scroll-snap-padding property</a></span><span><a href="#ref-for-scroll-container-33">6.1. Scroll Snapping Area: the scroll-snap-margin property</a> <a href="#ref-for-scroll-container-34">(2)</a></span><span><a href="#ref-for-scroll-container-35">6.2. Scroll Snapping Alignment: the scroll-snap-align property</a> <a href="#ref-for-scroll-container-36">(2)</a> <a href="#ref-for-scroll-container-37">(3)</a></span><span><a href="#ref-for-scroll-container-38">6.3. Axis vs Point-Snapping</a> <a href="#ref-for-scroll-container-39">(2)</a> <a href="#ref-for-scroll-container-40">(3)</a> <a href="#ref-for-scroll-container-41">(4)</a> <a href="#ref-for-scroll-container-42">(5)</a> <a href="#ref-for-scroll-container-43">(6)</a> <a href="#ref-for-scroll-container-44">(7)</a> <a href="#ref-for-scroll-container-45">(8)</a> <a href="#ref-for-scroll-container-46">(9)</a></span><span><a href="#ref-for-scroll-container-47">Physical Longhands for scroll-snap-padding</a></span><span><a href="#ref-for-scroll-container-48">Flow-relative Longhands for scroll-snap-padding</a></span></span></dfn>
<dd> An element which provides a scrolling user interface as described in <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a>, particularly in the section on overflow.
</dl>
<h2 class="heading settled" data-level="5" id="properties-on-the-scroll-container"><span class="secno">5. </span><span class="content">Capturing Scroll Snap Areas: Properties on the scroll container</span><a class="self-link" href="#properties-on-the-scroll-container"></a></h2>
<h3 class="heading settled" data-level="5.1" id="scroll-snap-type"><span class="secno">5.1. </span><span class="content">Scroll Snapping Rules: the <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-type" id="ref-for-propdef-scroll-snap-type-2">scroll-snap-type</a> property</span><a class="self-link" href="#scroll-snap-type"></a></h3>
<table class="def propdef" data-link-for-hint="scroll-snap-type">
<tbody>
<tr>
<th>Name:
<td><dfn class="dfn-paneled css" data-dfn-type="property" data-export="" data-lt="scroll-snap-type" id="propdef-scroll-snap-type">scroll-snap-type<span class="dfn-panel" data-deco=""><b><a href="#propdef-scroll-snap-type">#propdef-scroll-snap-type</a></b><b>Referenced in:</b><span><a href="#ref-for-propdef-scroll-snap-type-1">3. Overview</a></span><span><a href="#ref-for-propdef-scroll-snap-type-2">5.1. Scroll Snapping Rules: the scroll-snap-type property</a> <a href="#ref-for-propdef-scroll-snap-type-3">(2)</a> <a href="#ref-for-propdef-scroll-snap-type-4">(3)</a> <a href="#ref-for-propdef-scroll-snap-type-5">(4)</a></span></span></dfn>
<tr class="value">
<th>Value:
<td class="prod">none <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> [ [ mandatory <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> proximity ] [ x <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> y <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> block <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> inline ]<a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#mult-opt">?</a> ]<a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#mult-num-range">{1,2}</a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> [ mandatory <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> proximity ] point
<tr>
<th>Initial:
<td>none
<tr>
<th>Applies to:
<td><a href="https://drafts.csswg.org/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>n/a
<tr>
<th>Media:
<td>interactive
<tr>
<th>Computed value:
<td>as specified
<tr>
<th>Animatable:
<td>no
</table>
<p>The <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-type" id="ref-for-propdef-scroll-snap-type-3">scroll-snap-type</a> property specifies whether a <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-10">scroll container</a> is a <a data-link-type="dfn" href="#scroll-snap-container" id="ref-for-scroll-snap-container-1">scroll snap container</a>, how strictly a <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-11">scroll container</a> should <a data-link-type="dfn" href="#snap" id="ref-for-snap-2">snap</a>, and which axes are considered.</p>
<p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="strictness value" data-noexport="" id="strictness-value">strictness values<span class="dfn-panel" data-deco=""><b><a href="#strictness-value">#strictness-value</a></b><b>Referenced in:</b><span><a href="#ref-for-strictness-value-1">5.1. Scroll Snapping Rules: the scroll-snap-type property</a> <a href="#ref-for-strictness-value-2">(2)</a> <a href="#ref-for-strictness-value-3">(3)</a> <a href="#ref-for-strictness-value-4">(4)</a> <a href="#ref-for-strictness-value-5">(5)</a> <a href="#ref-for-strictness-value-6">(6)</a> <a href="#ref-for-strictness-value-7">(7)</a> <a href="#ref-for-strictness-value-8">(8)</a> <a href="#ref-for-strictness-value-9">(9)</a> <a href="#ref-for-strictness-value-10">(10)</a> <a href="#ref-for-strictness-value-11">(11)</a></span></span></dfn> (<a class="css" data-link-type="maybe" href="#valdef-scroll-snap-type-none" id="ref-for-valdef-scroll-snap-type-none-1">none</a>, <a class="css" data-link-type="maybe" href="#valdef-scroll-snap-type-proximity" id="ref-for-valdef-scroll-snap-type-proximity-1">proximity</a>, <a class="css" data-link-type="maybe" href="#valdef-scroll-snap-type-mandatory" id="ref-for-valdef-scroll-snap-type-mandatory-1">mandatory</a>)
specify how strictly <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-8">snap positions</a> are enforced on the <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-12">scroll container</a> (by forcing an adjustment to the scroll position).
Values are defined as follows:</p>
<p class="issue" id="issue-7e0cf181"><a class="self-link" href="#issue-7e0cf181"></a> <a href="https://lists.w3.org/Archives/Public/www-style/2015Nov/0328.html">Open issue</a> on whether to enhance the scroll-snap-type property for specifying the axis or adding a second property. We have <a href="https://lists.w3.org/Archives/Public/www-style/2015Dec/0048.html">resolved</a> that this functionality be added once the issue is resolved.</p>
<p class="issue" id="issue-780b32d8"><a class="self-link" href="#issue-780b32d8"></a> Currently considering renaming the values</p>
<dl>
<dt><dfn class="dfn-paneled css" data-dfn-for="scroll-snap-type" data-dfn-type="value" data-export="" data-lt="none" id="valdef-scroll-snap-type-none">none<span class="dfn-panel" data-deco=""><b><a href="#valdef-scroll-snap-type-none">#valdef-scroll-snap-type-none</a></b><b>Referenced in:</b><span><a href="#ref-for-valdef-scroll-snap-type-none-1">5.1. Scroll Snapping Rules: the scroll-snap-type property</a> <a href="#ref-for-valdef-scroll-snap-type-none-2">(2)</a> <a href="#ref-for-valdef-scroll-snap-type-none-3">(3)</a></span></span></dfn>
<dd> If specified on a <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-13">scroll container</a>, the <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-14">scroll container</a> must not <a data-link-type="dfn" href="#snap" id="ref-for-snap-3">snap</a>.
<dt><dfn class="dfn-paneled css" data-dfn-for="scroll-snap-type" data-dfn-type="value" data-export="" data-lt="mandatory" id="valdef-scroll-snap-type-mandatory">mandatory<span class="dfn-panel" data-deco=""><b><a href="#valdef-scroll-snap-type-mandatory">#valdef-scroll-snap-type-mandatory</a></b><b>Referenced in:</b><span><a href="#ref-for-valdef-scroll-snap-type-mandatory-1">5.1. Scroll Snapping Rules: the scroll-snap-type property</a></span><span><a href="#ref-for-valdef-scroll-snap-type-mandatory-2">6.3. Axis vs Point-Snapping</a></span></span></dfn>
<dd>
If specified on a <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-15">scroll container</a>, the <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-16">scroll container</a> is required to be <a data-link-type="dfn" href="#snap" id="ref-for-snap-4">snapped</a> to a snap position when there are no active scrolling operations. If a reachable snap position exists then the scroll container must <a data-link-type="dfn" href="#snap" id="ref-for-snap-5">snap</a> at the termination of a scroll (if none exist then no <a data-link-type="dfn" href="#snap" id="ref-for-snap-6">snapping</a> occurs).
<p>If the content changes such that the scroll container would no longer be <a data-link-type="dfn" href="#snap" id="ref-for-snap-7">snapped</a> (e.g. content is added, moved, deleted, resized) to the same snap position it was snapped to before the content change, the scroll container must be re-snapped. If the same snap position it was snapped to before the content change still exists (e.g. its associated element was not deleted) and is reachable, the scroll container must be re-snapped to that same snap position after the content change.</p>
<p>If specified on a non-<a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-17">scroll container</a>,
this value “traps” descendant boxes’ <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-9">snap positions</a>,
preventing them from affecting any ancestor <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-18">scroll containers</a>.</p>
<dt><dfn class="dfn-paneled css" data-dfn-for="scroll-snap-type" data-dfn-type="value" data-export="" data-lt="proximity" id="valdef-scroll-snap-type-proximity">proximity<span class="dfn-panel" data-deco=""><b><a href="#valdef-scroll-snap-type-proximity">#valdef-scroll-snap-type-proximity</a></b><b>Referenced in:</b><span><a href="#ref-for-valdef-scroll-snap-type-proximity-1">5.1. Scroll Snapping Rules: the scroll-snap-type property</a></span><span><a href="#ref-for-valdef-scroll-snap-type-proximity-2">6.3. Axis vs Point-Snapping</a></span></span></dfn>
<dd>
If specified on a <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-19">scroll container</a>, the <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-20">scroll container</a> may <a data-link-type="dfn" href="#snap" id="ref-for-snap-8">snap</a> to a snap position at the termination of a scroll, at the discretion of the UA given the parameters of the scroll.
<p>If the content changes such that the scroll container would no longer be <a data-link-type="dfn" href="#snap" id="ref-for-snap-9">snapped</a> (e.g. content is added, moved, deleted, resized) to the same snap position it was snapped to before the content change and that same snap position still exists (e.g. its associated element was not deleted) and is reachable, the scroll container must be re-snapped to that same snap position after the content change.</p>
<p class="issue" id="issue-3caf6830"><a class="self-link" href="#issue-3caf6830"></a> The text for mandatory and proximity resnapping requirements has some overlap -- try to rewrite this more concisely and without repetition without altering functionality</p>
<p>If specified on a non-<a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-21">scroll container</a>,
this value “traps” descendant boxes’ <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-10">snap positions</a>,
preventing them from affecting any ancestor <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-22">scroll containers</a>.</p>
</dl>
<p>A box <dfn class="dfn-paneled" data-dfn-type="dfn" data-export="" data-lt="captures snap positions" id="captures-snap-positions">captures snap positions<span class="dfn-panel" data-deco=""><b><a href="#captures-snap-positions">#captures-snap-positions</a></b><b>Referenced in:</b><span><a href="#ref-for-captures-snap-positions-1">5.1. Scroll Snapping Rules: the scroll-snap-type property</a></span></span></dfn> if it is a <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-23">scroll container</a> <em>or</em> has a value other than <a class="css" data-link-type="maybe" href="#valdef-scroll-snap-type-none" id="ref-for-valdef-scroll-snap-type-none-2">none</a> for <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-type" id="ref-for-propdef-scroll-snap-type-4">scroll-snap-type</a>.
If a box’s nearest <a data-link-type="dfn" href="#captures-snap-positions" id="ref-for-captures-snap-positions-1">snap-position capturing</a> ancestor
on its <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#containing-block-chain">containing block chain</a> is a <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-24">scroll container</a> with a non-<a class="css" data-link-type="maybe" href="#valdef-scroll-snap-type-none" id="ref-for-valdef-scroll-snap-type-none-3">none</a> value for <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-type" id="ref-for-propdef-scroll-snap-type-5">scroll-snap-type</a>,
that is the box’s <dfn class="dfn-paneled" data-dfn-type="dfn" data-export="" data-local-lt="snap container" data-lt="scroll snap container" id="scroll-snap-container">scroll snap container<span class="dfn-panel" data-deco=""><b><a href="#scroll-snap-container">#scroll-snap-container</a></b><b>Referenced in:</b><span><a href="#ref-for-scroll-snap-container-1">5.1. Scroll Snapping Rules: the scroll-snap-type property</a> <a href="#ref-for-scroll-snap-container-2">(2)</a></span><span><a href="#ref-for-scroll-snap-container-3">6.2. Scroll Snapping Alignment: the scroll-snap-align property</a></span></span></dfn>.
Otherwise, the box has no <a data-link-type="dfn" href="#scroll-snap-container" id="ref-for-scroll-snap-container-2">scroll snap container</a>,
and its <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-11">snap positions</a> do not trigger <a data-link-type="dfn" href="#snap" id="ref-for-snap-10">snapping</a>.</p>
<p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="axis value" data-noexport="" id="axis-value">axis values<span class="dfn-panel" data-deco=""><b><a href="#axis-value">#axis-value</a></b><b>Referenced in:</b><span><a href="#ref-for-axis-value-1">5.1. Scroll Snapping Rules: the scroll-snap-type property</a> <a href="#ref-for-axis-value-2">(2)</a> <a href="#ref-for-axis-value-3">(3)</a> <a href="#ref-for-axis-value-4">(4)</a></span></span></dfn> specify what axis(es) are affected by <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-12">snap positions</a>,
and whether <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-13">snap positions</a> are evaluated independently per axis,
or together as a 2D point.
Values are defined as follows:</p>
<dl>
<dt><dfn class="css" data-dfn-for="scroll-snap-type" data-dfn-type="value" data-export="" id="valdef-scroll-snap-type-x">x<a class="self-link" href="#valdef-scroll-snap-type-x"></a></dfn>
<dd> The <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-25">scroll container</a> <a data-link-type="dfn" href="#axis-snapping" id="ref-for-axis-snapping-1">axis-snaps</a> to <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-14">snap positions</a> in its horizontal axis using the corresponding <a data-link-type="dfn" href="#strictness-value" id="ref-for-strictness-value-1">strictness value</a>.
<dt><dfn class="css" data-dfn-for="scroll-snap-type" data-dfn-type="value" data-export="" id="valdef-scroll-snap-type-y">y<a class="self-link" href="#valdef-scroll-snap-type-y"></a></dfn>
<dd> The <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-26">scroll container</a> <a data-link-type="dfn" href="#axis-snapping" id="ref-for-axis-snapping-2">axis-snaps</a> to <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-15">snap positions</a> in its vertical axis using the corresponding <a data-link-type="dfn" href="#strictness-value" id="ref-for-strictness-value-2">strictness value</a>.
<dt><dfn class="css" data-dfn-for="scroll-snap-type" data-dfn-type="value" data-export="" id="valdef-scroll-snap-type-block">block<a class="self-link" href="#valdef-scroll-snap-type-block"></a></dfn>
<dd> The <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-27">scroll container</a> <a data-link-type="dfn" href="#axis-snapping" id="ref-for-axis-snapping-3">axis-snaps</a> to <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-16">snap positions</a> in its block axis using the corresponding <a data-link-type="dfn" href="#strictness-value" id="ref-for-strictness-value-3">strictness value</a>.
<dt><dfn class="css" data-dfn-for="scroll-snap-type" data-dfn-type="value" data-export="" id="valdef-scroll-snap-type-inline">inline<a class="self-link" href="#valdef-scroll-snap-type-inline"></a></dfn>
<dd> The <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-28">scroll container</a> <a data-link-type="dfn" href="#axis-snapping" id="ref-for-axis-snapping-4">axis-snaps</a> to <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-17">snap positions</a> in its inline axis using the corresponding <a data-link-type="dfn" href="#strictness-value" id="ref-for-strictness-value-4">strictness value</a>.
<dt><dfn class="css" data-dfn-for="scroll-snap-type" data-dfn-type="value" data-export="" id="valdef-scroll-snap-type-point">point<a class="self-link" href="#valdef-scroll-snap-type-point"></a></dfn>
<dd> The <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-29">scroll container</a> <a data-link-type="dfn" href="#point-snapping" id="ref-for-point-snapping-1">point-snaps</a> to <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-18">snap positions</a> in both axes simultaneously,
treating each element’s <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-19">snap position</a> as a single 2D position
(rather than potentially snapping to different elements in each axis).
</dl>
<p>If <a data-link-type="dfn" href="#axis-value" id="ref-for-axis-value-1">axis values</a> are not specified, then the axis is automatically computed:</p>
<ul>
<li data-md="">
<p>If only one <a data-link-type="dfn" href="#strictness-value" id="ref-for-strictness-value-5">strictness value</a> is specified, the <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-30">scroll container</a> <a data-link-type="dfn" href="#axis-snapping" id="ref-for-axis-snapping-5">axis-snaps</a> in both axes using that <a data-link-type="dfn" href="#strictness-value" id="ref-for-strictness-value-6">strictness value</a>.</p>
<li data-md="">
<p>If two <a data-link-type="dfn" href="#strictness-value" id="ref-for-strictness-value-7">strictness values</a> are specified and no <a data-link-type="dfn" href="#axis-value" id="ref-for-axis-value-2">axis values</a> are specified, the <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-31">scroll container</a> <a data-link-type="dfn" href="#axis-snapping" id="ref-for-axis-snapping-6">axis-snaps</a> in the horizontal axis using the first <a data-link-type="dfn" href="#strictness-value" id="ref-for-strictness-value-8">strictness value</a> and in the vertical axis using the second <a data-link-type="dfn" href="#strictness-value" id="ref-for-strictness-value-9">strictness value</a>.</p>
<li data-md="">
<p>If two <a data-link-type="dfn" href="#strictness-value" id="ref-for-strictness-value-10">strictness values</a> are specified and one <a data-link-type="dfn" href="#axis-value" id="ref-for-axis-value-3">axis value</a> is specified, the axis perpendicular to the specified <a data-link-type="dfn" href="#axis-value" id="ref-for-axis-value-4">axis value</a> is used for the other <a data-link-type="dfn" href="#strictness-value" id="ref-for-strictness-value-11">strictness value</a>.</p>
</ul>
<strong class="advisement"> Authors should use mandatory snap positions with consideration of
varyingly-sized screens and (if applicable) varying-sized content.
In particular, although access to snapped elements larger than the scrollport
is handled by the UA,
if authors assign mandatory snapping to non-adjacent siblings,
content in between can become inaccessible
in cases where it is longer than the screen.</strong>
<h3 class="heading settled" data-level="5.2" id="scroll-snap-padding"><span class="secno">5.2. </span><span class="content">Scroll Snapport: the <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding" id="ref-for-propdef-scroll-snap-padding-2">scroll-snap-padding</a> property</span><a class="self-link" href="#scroll-snap-padding"></a></h3>
<table class="def propdef" data-link-for-hint="scroll-snap-padding">
<tbody>
<tr>
<th>Name:
<td><dfn class="dfn-paneled css" data-dfn-type="property" data-export="" data-lt="scroll-snap-padding" id="propdef-scroll-snap-padding">scroll-snap-padding<span class="dfn-panel" data-deco=""><b><a href="#propdef-scroll-snap-padding">#propdef-scroll-snap-padding</a></b><b>Referenced in:</b><span><a href="#ref-for-propdef-scroll-snap-padding-1">3. Overview</a></span><span><a href="#ref-for-propdef-scroll-snap-padding-2">5.2. Scroll Snapport: the scroll-snap-padding property</a> <a href="#ref-for-propdef-scroll-snap-padding-3">(2)</a></span><span><a href="#ref-for-propdef-scroll-snap-padding-4">Physical Longhands for scroll-snap-padding</a> <a href="#ref-for-propdef-scroll-snap-padding-5">(2)</a></span><span><a href="#ref-for-propdef-scroll-snap-padding-6">Flow-relative Longhands for scroll-snap-padding</a> <a href="#ref-for-propdef-scroll-snap-padding-7">(2)</a> <a href="#ref-for-propdef-scroll-snap-padding-8">(3)</a></span></span></dfn>
<tr class="value">
<th>Value:
<td class="prod">[ <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" title="Expands to: em | advance measure | ch | vmin | cm | pc | pixel unit | in | rem | q | vh | ex | pt | vw | vmax | mm"><length></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#percentage-value"><percentage></a> ]<a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#mult-num-range">{1,4}</a>
<tr>
<th>Initial:
<td>0
<tr>
<th>Applies to:
<td><a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-32">scroll containers</a>
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>relative to the corresponding dimension of the scroll container’s scrollport
<tr>
<th>Media:
<td>interactive
<tr>
<th>Computed value:
<td>as specified, with lengths made absolute
<tr>
<th>Animatable:
<td>as length, percentage, or calc
</table>
<p>The <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding" id="ref-for-propdef-scroll-snap-padding-3">scroll-snap-padding</a> property defines the <dfn class="dfn-paneled" data-dfn-type="dfn" data-local-lt="snapport" data-lt="scroll snapport" data-noexport="" id="scroll-snapport">scroll snapport<span class="dfn-panel" data-deco=""><b><a href="#scroll-snapport">#scroll-snapport</a></b><b>Referenced in:</b><span><a href="#ref-for-scroll-snapport-1">3. Overview</a></span><span><a href="#ref-for-scroll-snapport-2">6.2. Scroll Snapping Alignment: the scroll-snap-align property</a> <a href="#ref-for-scroll-snapport-3">(2)</a> <a href="#ref-for-scroll-snapport-4">(3)</a> <a href="#ref-for-scroll-snapport-5">(4)</a></span><span><a href="#ref-for-scroll-snapport-6">Physical Longhands for scroll-snap-padding</a></span><span><a href="#ref-for-scroll-snapport-7">Flow-relative Longhands for scroll-snap-padding</a> <a href="#ref-for-scroll-snapport-8">(2)</a></span></span></dfn>, the area of the scrollport that is used as the <a data-link-type="dfn" href="https://drafts.csswg.org/css-align-3/#alignment-container">alignment container</a> for the <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-2">scroll snap areas</a> when calculating <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-20">snap positions</a>. Values are interpreted as for <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/box.html#propdef-padding">padding</a>, and specify inward offsets from each edge of the scrollport.</p>
<div class="example" id="example-505f05d7">
<a class="self-link" href="#example-505f05d7"></a> In this example, scroll-snap-padding is used to center slideshow images within the portion of the scrollport that is not obscured by a fixed-position toolbar.
<pre class="lang-css highlight"><span></span><span class="nt">body </span><span class="p">{</span>
<span class="k">overflow-x</span><span class="p">:</span> auto<span class="p">;</span>
<span class="k">overflow-y</span><span class="p">:</span> hidden<span class="p">;</span>
<span class="k">scroll-snap-type</span><span class="p">:</span> mandatory<span class="p">;</span>
<span class="k">scroll-snap-padding</span><span class="p">:</span> <span class="m">0</span> <span class="m">500</span><span class="l">px</span> <span class="m">0</span> <span class="m">0</span><span class="p">;</span>
<span class="p">}</span>
<span class="nt">.toolbar </span><span class="p">{</span>
<span class="k">position</span><span class="p">:</span> fixed<span class="p">;</span>
<span class="k">height</span><span class="p">:</span> <span class="m">10</span><span class="l">0</span>%;
width: 500px;
right: 0;
}
img {
scroll-snap-align: center none;
}</pre>
</div>
<p>This property is a <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-4/#shorthand-property">shorthand property</a> that sets all of the <a href="#longhands"><span class="css">scroll-snap-padding-*</span> longhands</a> in one declaration.</p>
<h2 class="heading settled" data-level="6" id="properties-on-the-elements"><span class="secno">6. </span><span class="content">Aligning Scroll Snap Areas: Properties on the elements</span><a class="self-link" href="#properties-on-the-elements"></a></h2>
<h3 class="heading settled" data-level="6.1" id="scroll-snap-margin"><span class="secno">6.1. </span><span class="content">Scroll Snapping Area: the <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin" id="ref-for-propdef-scroll-snap-margin-2">scroll-snap-margin</a> property</span><a class="self-link" href="#scroll-snap-margin"></a></h3>
<table class="def propdef" data-link-for-hint="scroll-snap-margin">
<tbody>
<tr>
<th>Name:
<td><dfn class="dfn-paneled css" data-dfn-type="property" data-export="" data-lt="scroll-snap-margin" id="propdef-scroll-snap-margin">scroll-snap-margin<span class="dfn-panel" data-deco=""><b><a href="#propdef-scroll-snap-margin">#propdef-scroll-snap-margin</a></b><b>Referenced in:</b><span><a href="#ref-for-propdef-scroll-snap-margin-1">3. Overview</a></span><span><a href="#ref-for-propdef-scroll-snap-margin-2">6.1. Scroll Snapping Area: the scroll-snap-margin property</a> <a href="#ref-for-propdef-scroll-snap-margin-3">(2)</a></span><span><a href="#ref-for-propdef-scroll-snap-margin-4">Physical Longhands for scroll-snap-margin</a> <a href="#ref-for-propdef-scroll-snap-margin-5">(2)</a></span><span><a href="#ref-for-propdef-scroll-snap-margin-6">Flow-relative Longhands for scroll-snap-margin</a> <a href="#ref-for-propdef-scroll-snap-margin-7">(2)</a> <a href="#ref-for-propdef-scroll-snap-margin-8">(3)</a></span></span></dfn>
<tr class="value">
<th>Value:
<td class="prod"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" title="Expands to: em | advance measure | ch | vmin | cm | pc | pixel unit | in | rem | q | vh | ex | pt | vw | vmax | mm"><length></a><a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#mult-num-range">{1,4}</a>
<tr>
<th>Initial:
<td>0
<tr>
<th>Applies to:
<td><a href="https://drafts.csswg.org/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>n/a
<tr>
<th>Media:
<td>interactive
<tr>
<th>Computed value:
<td>as specified, with lengths made absolute
<tr>
<th>Animatable:
<td>as length
</table>
<p>The <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin" id="ref-for-propdef-scroll-snap-margin-3">scroll-snap-margin</a> property defines
the <dfn class="dfn-paneled" data-dfn-type="dfn" data-local-lt="snap area" data-lt="scroll snap area" data-noexport="" id="scroll-snap-area">scroll snap area<span class="dfn-panel" data-deco=""><b><a href="#scroll-snap-area">#scroll-snap-area</a></b><b>Referenced in:</b><span><a href="#ref-for-scroll-snap-area-1">3. Overview</a></span><span><a href="#ref-for-scroll-snap-area-2">5.2. Scroll Snapport: the scroll-snap-padding property</a></span><span><a href="#ref-for-scroll-snap-area-3">6.1. Scroll Snapping Area: the scroll-snap-margin property</a> <a href="#ref-for-scroll-snap-area-4">(2)</a></span><span><a href="#ref-for-scroll-snap-area-5">6.2. Scroll Snapping Alignment: the scroll-snap-align property</a> <a href="#ref-for-scroll-snap-area-6">(2)</a> <a href="#ref-for-scroll-snap-area-7">(3)</a> <a href="#ref-for-scroll-snap-area-8">(4)</a></span><span><a href="#ref-for-scroll-snap-area-9">Physical Longhands for scroll-snap-margin</a></span><span><a href="#ref-for-scroll-snap-area-10">Flow-relative Longhands for scroll-snap-margin</a> <a href="#ref-for-scroll-snap-area-11">(2)</a></span></span></dfn> that is used for snapping this box to the snapport.
The <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" title="Expands to: em | advance measure | ch | vmin | cm | pc | pixel unit | in | rem | q | vh | ex | pt | vw | vmax | mm"><length></a> values give outsets
(interpreted as for <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/box.html#propdef-margin">margin</a> or <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-backgrounds-3/#border-image-outset">border-image-outset</a>).
The <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-3">scroll snap area</a> is the rectangular bounding box of the transformed border box,
plus the specified outsets,
axis-aligned in the <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-33">scroll container’s</a> coordinate space.</p>
<p class="note" role="note">Note: This ensures that the <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-4">scroll snap area</a> is always rectangular and axis-aligned to the <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-34">scroll container’s</a> coordinate space.</p>
<p>This property is a <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-4/#shorthand-property">shorthand property</a> that sets all of the <a href="#longhands"><span class="css">scroll-snap-margin-*</span> longhands</a> in one declaration.</p>
<h3 class="heading settled" data-level="6.2" id="scroll-snap-align"><span class="secno">6.2. </span><span class="content">Scroll Snapping Alignment: the <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-align" id="ref-for-propdef-scroll-snap-align-2">scroll-snap-align</a> property</span><a class="self-link" href="#scroll-snap-align"></a></h3>
<table class="def propdef" data-link-for-hint="scroll-snap-align">
<tbody>
<tr>
<th>Name:
<td><dfn class="dfn-paneled css" data-dfn-type="property" data-export="" data-lt="scroll-snap-align" id="propdef-scroll-snap-align">scroll-snap-align<span class="dfn-panel" data-deco=""><b><a href="#propdef-scroll-snap-align">#propdef-scroll-snap-align</a></b><b>Referenced in:</b><span><a href="#ref-for-propdef-scroll-snap-align-1">3. Overview</a></span><span><a href="#ref-for-propdef-scroll-snap-align-2">6.2. Scroll Snapping Alignment: the scroll-snap-align property</a> <a href="#ref-for-propdef-scroll-snap-align-3">(2)</a></span></span></dfn>
<tr class="value">
<th>Value:
<td class="prod">[ none <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> start <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> end <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> center ]<a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#mult-num-range">{1,2}</a>
<tr>
<th>Initial:
<td>none
<tr>
<th>Applies to:
<td><a href="https://drafts.csswg.org/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>n/a
<tr>
<th>Media:
<td>interactive
<tr>
<th>Computed value:
<td>two keywords
<tr>
<th>Animatable:
<td>no
</table>
<p>The <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-align" id="ref-for-propdef-scroll-snap-align-3">scroll-snap-align</a> property specifies
the box’s <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-21">snap position</a> as an alignment of
its <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-5">snap area</a> (as the <a data-link-type="dfn" href="https://drafts.csswg.org/css-align-3/#alignment-subject">alignment subject</a>)
within its <a data-link-type="dfn" href="#scroll-snap-container" id="ref-for-scroll-snap-container-3">snap container’s</a> <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-2">snapport</a> (as the <a data-link-type="dfn" href="https://drafts.csswg.org/css-align-3/#alignment-container">alignment container</a>). The two values specify the snapping behavior in the x and y axes, respectively. If only one value is specified, the second value defaults to the same value.</p>
<p class="issue" id="issue-f7391e31"><a class="self-link" href="#issue-f7391e31"></a> Should this be x/y axes, or inline/block? Starting with x/y axes for consistency with padding/area, otherwise a writing mode change would result in a axis mismatch (since padding is physical by default).</p>
<p>Values are defined as follows:</p>
<dl>
<dt><dfn class="css" data-dfn-for="scroll-snap-align" data-dfn-type="value" data-export="" id="valdef-scroll-snap-align-none">none<a class="self-link" href="#valdef-scroll-snap-align-none"></a></dfn>
<dd> This box does not define a <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-22">snap position</a> in the specified axis.
<dt><dfn class="css" data-dfn-for="scroll-snap-align" data-dfn-type="value" data-export="" id="valdef-scroll-snap-align-start">start<a class="self-link" href="#valdef-scroll-snap-align-start"></a></dfn>
<dd> Start alignment of this box’s <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-6">scroll snap area</a> within the <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-35">scroll container</a>’s <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-3">snapport</a> is a <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-23">snap position</a> in the specified axis.
<dt><dfn class="css" data-dfn-for="scroll-snap-align" data-dfn-type="value" data-export="" id="valdef-scroll-snap-align-end">end<a class="self-link" href="#valdef-scroll-snap-align-end"></a></dfn>
<dd> End alignment of this box’s <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-7">scroll snap area</a> within the <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-36">scroll container</a>’s <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-4">snapport</a> is a <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-24">snap position</a> in the specified axis.
<dt><dfn class="css" data-dfn-for="scroll-snap-align" data-dfn-type="value" data-export="" id="valdef-scroll-snap-align-center">center<a class="self-link" href="#valdef-scroll-snap-align-center"></a></dfn>
<dd> Center alignment of this box’s <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-8">scroll snap area</a> within the <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-37">scroll container</a>’s <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-5">snapport</a> is a <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-25">snap position</a> in the specified axis.
</dl>
<h3 class="heading settled" data-level="6.3" id="snap-dimensions"><span class="secno">6.3. </span><span class="content">Axis vs Point-Snapping</span><a class="self-link" href="#snap-dimensions"></a></h3>
<p class="issue" id="issue-81937a94"><a class="self-link" href="#issue-81937a94"></a> This feature is planned to be removed in the next publication
in order to reduce the feature-set of Level 1.
It is included here for future reference in defining Level 2.</p>
<p>There are two distinct <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="snap behavior|snapping behavior" data-noexport="" id="snap-behavior">snapping behaviors<span class="dfn-panel" data-deco=""><b><a href="#snap-behavior">#snap-behavior</a></b><b>Referenced in:</b><span><a href="#ref-for-snap-behavior-1">6.3. Axis vs Point-Snapping</a> <a href="#ref-for-snap-behavior-2">(2)</a></span></span></dfn> that a <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-38">scroll container</a> might engage in:</p>
<dl>
<dt data-md="">
<p><dfn class="dfn-paneled" data-dfn-type="dfn" data-export="" data-local-lt="axis" data-lt="axis-snapping|axis-snap" id="axis-snapping">axis-snapping<span class="dfn-panel" data-deco=""><b><a href="#axis-snapping">#axis-snapping</a></b><b>Referenced in:</b><span><a href="#ref-for-axis-snapping-1">5.1. Scroll Snapping Rules: the scroll-snap-type property</a> <a href="#ref-for-axis-snapping-2">(2)</a> <a href="#ref-for-axis-snapping-3">(3)</a> <a href="#ref-for-axis-snapping-4">(4)</a> <a href="#ref-for-axis-snapping-5">(5)</a> <a href="#ref-for-axis-snapping-6">(6)</a></span><span><a href="#ref-for-axis-snapping-7">6.3. Axis vs Point-Snapping</a> <a href="#ref-for-axis-snapping-8">(2)</a> <a href="#ref-for-axis-snapping-9">(3)</a></span></span></dfn></p>
<dd data-md="">
<p>If a <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-39">scroll container</a> is <a data-link-type="dfn" href="#axis-snapping" id="ref-for-axis-snapping-7">axis-snapping</a>,
its descendants indicate a desired scroll position
in each axis of the <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-40">scroll container</a> independently,
with no dependent preference for what the other axis’s scroll position should be.</p>
<p class="note" role="note">Note: This is the “default” type of <a data-link-type="dfn" href="#snap-behavior" id="ref-for-snap-behavior-1">snap behavior</a> that most <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-41">scroll containers</a> will want to use,
and so the <span class="css">scroll-snap-type</span> property intentionally defaults to it.</p>
<p class="note" role="note">Note: An element in an <a data-link-type="dfn" href="#axis-snapping" id="ref-for-axis-snapping-8">axis-snapping</a> <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-42">scroll container</a> can declare two <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-26">snap positions</a>,
one in each axis.
If one of the element’s <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-27">snap positions</a> is chosen in one axis,
this has no bearing on the other dimension’s <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-28">snap position</a>—<wbr>it might be chosen,
or a different element’s <a data-link-type="dfn" href="#scroll-snap-position" id="ref-for-scroll-snap-position-29">snap position</a> might be chosen for that axis,
or that axis might not snap at all.</p>
<dt data-md="">
<p><dfn class="dfn-paneled" data-dfn-type="dfn" data-export="" data-local-lt="point" data-lt="point-snapping|point-snap" id="point-snapping">point-snapping<span class="dfn-panel" data-deco=""><b><a href="#point-snapping">#point-snapping</a></b><b>Referenced in:</b><span><a href="#ref-for-point-snapping-1">5.1. Scroll Snapping Rules: the scroll-snap-type property</a></span><span><a href="#ref-for-point-snapping-2">6.3. Axis vs Point-Snapping</a></span></span></dfn></p>
<dd data-md="">
<p>If a <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-43">scroll container</a> is <a data-link-type="dfn" href="#point-snapping" id="ref-for-point-snapping-2">point-snapping</a>,
its descendants indicate a desired scroll position
in both axes of the <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-44">scroll container</a> simultaneously—<wbr>in other words,
some point in the descendant must be aligned to a corresponding point in the <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-45">scroll container</a>.</p>
<p>This type of <a data-link-type="dfn" href="#snap-behavior" id="ref-for-snap-behavior-2">snapping behavior</a> is intended for "two-dimensional" panning-type layouts,
such as cities on a map
(using <a class="css" data-link-type="maybe" href="#valdef-scroll-snap-type-proximity" id="ref-for-valdef-scroll-snap-type-proximity-2">proximity</a> 2D snap positions to snap a city to the center of the display when it gets close),
or a tiled image gallery
(using <a class="css" data-link-type="maybe" href="#valdef-scroll-snap-type-mandatory" id="ref-for-valdef-scroll-snap-type-mandatory-2">mandatory</a> 2D snap positions to force each image to be centered on the screen).
In both of these cases,
it would look weird if the horizontal scrolling was aligned to one element
while the vertical was aligned to a different element
(which is the behavior you’d get if the <a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-46">scroll container</a> was <a data-link-type="dfn" href="#axis-snapping" id="ref-for-axis-snapping-9">axis-snapping</a>).</p>
</dl>
<h2 class="heading settled" id="longhands"><span class="content">Appendix A: Longhands</span><a class="self-link" href="#longhands"></a></h2>
<h3 class="heading settled" id="padding-longhands-physical"><span class="content">Physical Longhands for <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding" id="ref-for-propdef-scroll-snap-padding-4">scroll-snap-padding</a></span><a class="self-link" href="#padding-longhands-physical"></a></h3>
<table class="def propdef" data-link-for-hint="scroll-snap-padding-top">
<tbody>
<tr>
<th>Name:
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-padding-top">scroll-snap-padding-top<a class="self-link" href="#propdef-scroll-snap-padding-top"></a></dfn>, <dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-padding-right">scroll-snap-padding-right<a class="self-link" href="#propdef-scroll-snap-padding-right"></a></dfn>, <dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-padding-bottom">scroll-snap-padding-bottom<a class="self-link" href="#propdef-scroll-snap-padding-bottom"></a></dfn>, <dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-padding-left">scroll-snap-padding-left<a class="self-link" href="#propdef-scroll-snap-padding-left"></a></dfn>
<tr class="value">
<th>Value:
<td class="prod"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" title="Expands to: em | advance measure | ch | vmin | cm | pc | pixel unit | in | rem | q | vh | ex | pt | vw | vmax | mm"><length></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#percentage-value"><percentage></a>
<tr>
<th>Initial:
<td>0
<tr>
<th>Applies to:
<td><a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-47">scroll containers</a>
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>relative to the scroll container’s scrollport
<tr>
<th>Media:
<td>interactive
<tr>
<th>Computed value:
<td>as specified, with lengths made absolute
<tr>
<th>Animatable:
<td>as length, percentage, or calc
</table>
<p>These <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-4/#longhand">longhands</a> of <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding" id="ref-for-propdef-scroll-snap-padding-5">scroll-snap-padding</a> specify the top, right, bottom, and left edges of the <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-6">snapport</a>, respectively.</p>
<h3 class="heading settled" id="padding-longhands-logical"><span class="content">Flow-relative Longhands for <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding" id="ref-for-propdef-scroll-snap-padding-6">scroll-snap-padding</a></span><a class="self-link" href="#padding-longhands-logical"></a></h3>
<table class="def propdef" data-link-for-hint="scroll-snap-padding-inline-start">
<tbody>
<tr>
<th>Name:
<td><dfn class="dfn-paneled css" data-dfn-type="property" data-export="" data-lt="scroll-snap-padding-inline-start" id="propdef-scroll-snap-padding-inline-start">scroll-snap-padding-inline-start<span class="dfn-panel" data-deco=""><b><a href="#propdef-scroll-snap-padding-inline-start">#propdef-scroll-snap-padding-inline-start</a></b><b>Referenced in:</b><span><a href="#ref-for-propdef-scroll-snap-padding-inline-start-1">Flow-relative Longhands for scroll-snap-padding</a></span></span></dfn>, <dfn class="dfn-paneled css" data-dfn-type="property" data-export="" data-lt="scroll-snap-padding-block-start" id="propdef-scroll-snap-padding-block-start">scroll-snap-padding-block-start<span class="dfn-panel" data-deco=""><b><a href="#propdef-scroll-snap-padding-block-start">#propdef-scroll-snap-padding-block-start</a></b><b>Referenced in:</b><span><a href="#ref-for-propdef-scroll-snap-padding-block-start-1">Flow-relative Longhands for scroll-snap-padding</a></span></span></dfn>, <dfn class="dfn-paneled css" data-dfn-type="property" data-export="" data-lt="scroll-snap-padding-inline-end" id="propdef-scroll-snap-padding-inline-end">scroll-snap-padding-inline-end<span class="dfn-panel" data-deco=""><b><a href="#propdef-scroll-snap-padding-inline-end">#propdef-scroll-snap-padding-inline-end</a></b><b>Referenced in:</b><span><a href="#ref-for-propdef-scroll-snap-padding-inline-end-1">Flow-relative Longhands for scroll-snap-padding</a></span></span></dfn>, <dfn class="dfn-paneled css" data-dfn-type="property" data-export="" data-lt="scroll-snap-padding-block-end" id="propdef-scroll-snap-padding-block-end">scroll-snap-padding-block-end<span class="dfn-panel" data-deco=""><b><a href="#propdef-scroll-snap-padding-block-end">#propdef-scroll-snap-padding-block-end</a></b><b>Referenced in:</b><span><a href="#ref-for-propdef-scroll-snap-padding-block-end-1">Flow-relative Longhands for scroll-snap-padding</a></span></span></dfn>
<tr class="value">
<th>Value:
<td class="prod"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" title="Expands to: em | advance measure | ch | vmin | cm | pc | pixel unit | in | rem | q | vh | ex | pt | vw | vmax | mm"><length></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#percentage-value"><percentage></a>
<tr>
<th>Initial:
<td>0
<tr>
<th>Applies to:
<td><a data-link-type="dfn" href="#scroll-container" id="ref-for-scroll-container-48">scroll containers</a>
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>relative to the scroll container’s scrollport
<tr>
<th>Media:
<td>interactive
<tr>
<th>Computed value:
<td>as specified, with lengths made absolute
<tr>
<th>Animatable:
<td>as length, percentage, or calc
</table>
<p>These <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-4/#longhand">longhands</a> of <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding" id="ref-for-propdef-scroll-snap-padding-7">scroll-snap-padding</a> specify the block-start, inline-start, block-end, and inline-end edges of the <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-7">snapport</a>, respectively.</p>
<table class="def propdef" data-link-for-hint="scroll-snap-padding-block">
<tbody>
<tr>
<th>Name:
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-padding-block">scroll-snap-padding-block<a class="self-link" href="#propdef-scroll-snap-padding-block"></a></dfn>, <dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-padding-inline">scroll-snap-padding-inline<a class="self-link" href="#propdef-scroll-snap-padding-inline"></a></dfn>
<tr class="value">
<th>Value:
<td class="prod">[ <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" title="Expands to: em | advance measure | ch | vmin | cm | pc | pixel unit | in | rem | q | vh | ex | pt | vw | vmax | mm"><length></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#percentage-value"><percentage></a> ]<a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#mult-num-range">{1,2}</a>
<tr>
<th>Initial:
<td>0
<tr>
<th>Applies to:
<td><a href="https://drafts.csswg.org/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>relative to the scroll container’s scrollport
<tr>
<th>Media:
<td>interactive
<tr>
<th>Computed value:
<td>as specified, with lengths made absolute
<tr>
<th>Animatable:
<td>as length, percentage, or calc
</table>
<p>These <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-4/#shorthand-property">shorthands</a> of <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding-block-start" id="ref-for-propdef-scroll-snap-padding-block-start-1">scroll-snap-padding-block-start</a> + <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding-block-end" id="ref-for-propdef-scroll-snap-padding-block-end-1">scroll-snap-padding-block-end</a> and <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding-inline-start" id="ref-for-propdef-scroll-snap-padding-inline-start-1">scroll-snap-padding-inline-start</a> + <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding-inline-end" id="ref-for-propdef-scroll-snap-padding-inline-end-1">scroll-snap-padding-inline-end</a> are <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-4/#longhand">longhands</a> of <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding" id="ref-for-propdef-scroll-snap-padding-8">scroll-snap-padding</a>, and specify the block-axis and inline-axis edges of the <a data-link-type="dfn" href="#scroll-snapport" id="ref-for-scroll-snapport-8">snapport</a>, respectively.</p>
<p>If two values are specified, the first gives the start value and the second gives the end value.</p>
<h3 class="heading settled" id="margin-longhands-physical"><span class="content">Physical Longhands for <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin" id="ref-for-propdef-scroll-snap-margin-4">scroll-snap-margin</a></span><a class="self-link" href="#margin-longhands-physical"></a></h3>
<table class="def propdef" data-link-for-hint="scroll-snap-margin-top">
<tbody>
<tr>
<th>Name:
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-margin-top">scroll-snap-margin-top<a class="self-link" href="#propdef-scroll-snap-margin-top"></a></dfn>, <dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-margin-right">scroll-snap-margin-right<a class="self-link" href="#propdef-scroll-snap-margin-right"></a></dfn>, <dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-margin-bottom">scroll-snap-margin-bottom<a class="self-link" href="#propdef-scroll-snap-margin-bottom"></a></dfn>, <dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-margin-left">scroll-snap-margin-left<a class="self-link" href="#propdef-scroll-snap-margin-left"></a></dfn>
<tr class="value">
<th>Value:
<td class="prod"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" title="Expands to: em | advance measure | ch | vmin | cm | pc | pixel unit | in | rem | q | vh | ex | pt | vw | vmax | mm"><length></a>
<tr>
<th>Initial:
<td>0
<tr>
<th>Applies to:
<td><a href="https://drafts.csswg.org/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>n/a
<tr>
<th>Media:
<td>interactive
<tr>
<th>Computed value:
<td>as specified, with lengths made absolute
<tr>
<th>Animatable:
<td>as length
</table>
<p>These <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-4/#longhand">longhands</a> of <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin" id="ref-for-propdef-scroll-snap-margin-5">scroll-snap-margin</a> specify the top, right, bottom, and left edges of the <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-9">scroll snap area</a>, respectively.</p>
<h3 class="heading settled" id="margin-longhands-logical"><span class="content">Flow-relative Longhands for <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin" id="ref-for-propdef-scroll-snap-margin-6">scroll-snap-margin</a></span><a class="self-link" href="#margin-longhands-logical"></a></h3>
<table class="def propdef" data-link-for-hint="scroll-snap-margin-block-start">
<tbody>
<tr>
<th>Name:
<td><dfn class="dfn-paneled css" data-dfn-type="property" data-export="" data-lt="scroll-snap-margin-block-start" id="propdef-scroll-snap-margin-block-start">scroll-snap-margin-block-start<span class="dfn-panel" data-deco=""><b><a href="#propdef-scroll-snap-margin-block-start">#propdef-scroll-snap-margin-block-start</a></b><b>Referenced in:</b><span><a href="#ref-for-propdef-scroll-snap-margin-block-start-1">Flow-relative Longhands for scroll-snap-margin</a></span></span></dfn>, <dfn class="dfn-paneled css" data-dfn-type="property" data-export="" data-lt="scroll-snap-margin-inline-start" id="propdef-scroll-snap-margin-inline-start">scroll-snap-margin-inline-start<span class="dfn-panel" data-deco=""><b><a href="#propdef-scroll-snap-margin-inline-start">#propdef-scroll-snap-margin-inline-start</a></b><b>Referenced in:</b><span><a href="#ref-for-propdef-scroll-snap-margin-inline-start-1">Flow-relative Longhands for scroll-snap-margin</a></span></span></dfn>, <dfn class="dfn-paneled css" data-dfn-type="property" data-export="" data-lt="scroll-snap-margin-block-end" id="propdef-scroll-snap-margin-block-end">scroll-snap-margin-block-end<span class="dfn-panel" data-deco=""><b><a href="#propdef-scroll-snap-margin-block-end">#propdef-scroll-snap-margin-block-end</a></b><b>Referenced in:</b><span><a href="#ref-for-propdef-scroll-snap-margin-block-end-1">Flow-relative Longhands for scroll-snap-margin</a></span></span></dfn>, <dfn class="dfn-paneled css" data-dfn-type="property" data-export="" data-lt="scroll-snap-margin-inline-end" id="propdef-scroll-snap-margin-inline-end">scroll-snap-margin-inline-end<span class="dfn-panel" data-deco=""><b><a href="#propdef-scroll-snap-margin-inline-end">#propdef-scroll-snap-margin-inline-end</a></b><b>Referenced in:</b><span><a href="#ref-for-propdef-scroll-snap-margin-inline-end-1">Flow-relative Longhands for scroll-snap-margin</a></span></span></dfn>
<tr class="value">
<th>Value:
<td class="prod"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" title="Expands to: em | advance measure | ch | vmin | cm | pc | pixel unit | in | rem | q | vh | ex | pt | vw | vmax | mm"><length></a>
<tr>
<th>Initial:
<td>0
<tr>
<th>Applies to:
<td><a href="https://drafts.csswg.org/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>n/a
<tr>
<th>Media:
<td>interactive
<tr>
<th>Computed value:
<td>as specified, with lengths made absolute
<tr>
<th>Animatable:
<td>as length
</table>
<p>These <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-4/#longhand">longhands</a> of <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin" id="ref-for-propdef-scroll-snap-margin-7">scroll-snap-margin</a> specify the block-start, inline-start, block-end, and inline-end edges of the <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-10">scroll snap area</a>, respectively.</p>
<table class="def propdef" data-link-for-hint="scroll-snap-margin-block">
<tbody>
<tr>
<th>Name:
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-margin-block">scroll-snap-margin-block<a class="self-link" href="#propdef-scroll-snap-margin-block"></a></dfn>, <dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-margin-inline">scroll-snap-margin-inline<a class="self-link" href="#propdef-scroll-snap-margin-inline"></a></dfn>
<tr class="value">
<th>Value:
<td class="prod"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" title="Expands to: em | advance measure | ch | vmin | cm | pc | pixel unit | in | rem | q | vh | ex | pt | vw | vmax | mm"><length></a><a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#mult-num-range">{1,2}</a>
<tr>
<th>Initial:
<td>0
<tr>
<th>Applies to:
<td><a href="https://drafts.csswg.org/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>n/a
<tr>
<th>Media:
<td>interactive
<tr>
<th>Computed value:
<td>as specified, with lengths made absolute
<tr>
<th>Animatable:
<td>as length
</table>
<p>These <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-4/#shorthand-property">shorthands</a> of <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin-block-start" id="ref-for-propdef-scroll-snap-margin-block-start-1">scroll-snap-margin-block-start</a> + <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin-block-end" id="ref-for-propdef-scroll-snap-margin-block-end-1">scroll-snap-margin-block-end</a> and <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin-inline-start" id="ref-for-propdef-scroll-snap-margin-inline-start-1">scroll-snap-margin-inline-start</a> + <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin-inline-end" id="ref-for-propdef-scroll-snap-margin-inline-end-1">scroll-snap-margin-inline-end</a> are <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-4/#longhand">longhands</a> of <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin" id="ref-for-propdef-scroll-snap-margin-8">scroll-snap-margin</a>, and specify the block-axis and inline-axis edges of the <a data-link-type="dfn" href="#scroll-snap-area" id="ref-for-scroll-snap-area-11">scroll snap area</a>, respectively.</p>
<p>If two values are specified, the first gives the start value and the second gives the end value.</p>
<h2 class="heading settled" data-level="7" id="priv-sec"><span class="secno">7. </span><span class="content">Privacy and Security Considerations</span><a class="self-link" href="#priv-sec"></a></h2>
<p>This specification does not expose any information whatsoever that is not already exposed to the DOM directly; it just makes scrolling slightly more functional. There are no new privacy or security considerations.</p>
<h2 class="heading settled" data-level="8" id="acknowledgements"><span class="secno">8. </span><span class="content">Acknowledgements</span><a class="self-link" href="#acknowledgements"></a></h2>
<p>Many thanks to
David Baron,
Simon Fraser,
Håkon Wium Lie,
Edward O’Connor,
François Remy,
Majid Valpour,
Tab Atkins-Bittner,
Elika J. Etemad / fantasai,
and most especially Robert O’Callahan
for their proposals and recommendations,
which have been incorporated into this document.</p>
</main>
<h2 class="no-ref no-num heading settled" id="conformance"><span class="content"> Conformance</span><a class="self-link" href="#conformance"></a></h2>
<h3 class="heading settled" id="document-conventions"><span class="content"> Document conventions</span><a class="self-link" href="#document-conventions"></a></h3>
<p>Conformance requirements are expressed with a combination of
descriptive assertions and RFC 2119 terminology. The key words “MUST”,
“MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”,
“RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this
document are to be interpreted as described in RFC 2119.
However, for readability, these words do not appear in all uppercase
letters in this specification. </p>
<p>All of the text of this specification is normative except sections
explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a> </p>
<p>Examples in this specification are introduced with the words “for example”
or are set apart from the normative text with <code>class="example"</code>,
like this: </p>
<div class="example" id="example-52448c84">
<a class="self-link" href="#example-52448c84"></a>
<p>This is an example of an informative example. </p>
</div>
<p>Informative notes begin with the word “Note” and are set apart from the
normative text with <code>class="note"</code>, like this: </p>
<p class="note" role="note">Note, this is an informative note. </p>
<p>Advisements are normative sections styled to evoke special attention and are
set apart from other normative text with <code><strong class="advisement"></code>, like
this: <strong class="advisement"> UAs MUST provide an accessible alternative. </strong> </p>