-
Notifications
You must be signed in to change notification settings - Fork 790
Expand file tree
/
Copy pathOverview.html
More file actions
697 lines (696 loc) · 56.4 KB
/
Overview.html
File metadata and controls
697 lines (696 loc) · 56.4 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
<!doctype html><html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>CSS Scroll Snap Points Module Level 1</title>
<meta content="width=device-width, initial-scale=1" 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>.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 .cm { color: #708090 } /* Comment.Multiline */
.highlight .cp { color: #708090 } /* Comment.Preproc */
.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>
</head>
<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/Icons/w3c_home" width="72"> </a> </p>
<h1 class="p-name no-ref" id="title">CSS Scroll Snap Points 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-01-20">20 January 2016</time></span></h2>
<div data-fill-with="spec-metadata">
<dl>
<dt>This version:
<dd><a class="u-url" href="http://dev.w3.org/csswg/css-snappoints/">http://dev.w3.org/csswg/css-snappoints/</a>
<dt>Latest version:
<dd><a href="http://www.w3.org/TR/css-snappoints-1/">http://www.w3.org/TR/css-snappoints-1/</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>
<dd><span><a href="http://wiki.csswg.org/spec/css-snappoints">http://wiki.csswg.org/spec/css-snappoints</a></span>
<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="#scroll-snap-type"><
991F
span class="secno">5</span> <span class="content">Scroll Snap Types: the <span class="property">scroll-snap-type</span> property</span></a>
<li><a href="#scroll-snap-padding"><span class="secno">6</span> <span class="content">Scroll Snap Padding: the <span class="property">scroll-snap-padding</span> property</span></a>
<li><a href="#scroll-snap-margin0"><span class="secno">7</span> <span class="content">Scroll Snap Margin: the <span class="property">scroll-snap-margin</span> property</span></a>
<li><a href="#scroll-snap-align"><span class="secno">8</span> <span class="content">Scroll Snap Align: the <span class="property">scroll-snap-align</span> property</span></a>
<li><a href="#acknowledgments"><span class="secno"></span> <span class="content">Acknowledgments</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>
<li><a href="#informative"><span class="secno"></span> <span class="content">Informative 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 offset
which leaves a page partially on-screen when panning.</p>
<p>To this end, we introduce scroll snap positions
which enforce the scroll offsets that a <a data-link-type="dfn" href="#scroll-container">scroll container’s</a> visual viewport 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="http://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"><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-b17d46c1">
<a class="self-link" href="#example-b17d46c1"></a> In this example, a series of images arranged in a <a data-link-type="dfn" href="#scroll-container">scroll container</a> are used to build a photo gallery. In this example the <a data-link-type="dfn" href="#scroll-container">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">scroll container’s</a> visual viewport.
<pre class="lang-css highlight"><span class="nt">img </span><span class="p">{</span>
<span class="p">/</span>* Specifies that the center of each photo
should align with the center of the scroll
container in the X axis when snapping */
scroll-snap-align: center none;
}
.photoGallery {
width: 500px;
overflow-x: auto;
overflow-y: hidden;
white-space: nowrap;
/* Requires that the scroll offset always be
at a valid snap position when the scrolling
operation completes. */
scroll-snap-type: mandatory;
}</pre>
<pre class="lang-html highlight"><span class="nt"><div</span> <span class="na">class=</span><span class="s">"photoGallery"</span><span class="nt">></span>
<span class="nt"><img</span> <span class="na">src=</span><span class="s">"img1.jpg"</span><span class="nt">></span>
<span class="nt"><img</span> <span class="na">src=</span><span class="s">"img2.jpg"</span><span class="nt">></span>
<span class="nt"><img</span> <span class="na">src=</span><span class="s">"img3.jpg"</span><span class="nt">></span>
<span class="nt"><img</span> <span class="na">src=</span><span class="s">"img4.jpg"</span><span class="nt">></span>
<span class="nt"><img</span> <span class="na">src=</span><span class="s">"img5.jpg"</span><span class="nt">></span>
<span class="nt"></div></span></pre>
<figure>
<img alt="" src="element_snap_positions.png">
<figcaption> The layout of the scroll container’s contents in the example.
The snap alignment container is represented by the red rectangle, and the snap margin 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 offset which aligns the X-center of the snap alignment container (represented by a red dotted line) with the X-center of a snap margin (represented by a yellow dotted line). </figcaption>
</figure>
</div>
<div class="example" id="example-5b068871">
<a class="self-link" href="#example-5b068871"></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">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 class="nt">.page </span><span class="p">{</span>
<span class="p">/</span>* Defines the top of each page as the
edge that should be used for snapping */
scroll-snap-align: none start;
}
.docScroller {
width: 500px;
overflow-x: hidden;
overflow-y: auto;
/* Specifies that each element’s snap margin should
align with a 100px offset from the top edge. */
scroll-snap-padding: 100px 0 0;
/* Encourages scrolling to end at a snap position when the
operation completes, if it is near a valid snap position */
scroll-snap-type: proximity;
}</pre>
<pre class="lang-html highlight"><span class="nt"><div</span> <span class="na">class=</span><span class="s">"docScroller"</span><span class="nt">></span>
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"page"</span><span class="nt">></span>Page 1<span class="nt"></div></span>
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"page"</span><span class="nt">></span>Page 2<span class="nt"></div></span>
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"page"</span><span class="nt">></span>Page 3<span class="nt"></div></span>
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"page"</span><span class="nt">></span>Page 4<span class="nt"></div></span>
<span class="nt"></div></span></pre>
<figure>
<img alt="" src="element_snap_positions_offset.png">
<figcaption> The layout of the scroll container’s contents in the example.
The snap alignment container is represented by the red rectangle (inset from the top by 100px due to the scroll-snap-padding), and the snap margin 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 offset which aligns the Y-start of the snap alignment container (represented by a red dotted line) with the Y-start of a snap margin (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 <a data-link-type="dfn" href="#scroll-snap-position">scroll snap positions</a>,
which are scroll positions that produce particular alignments
of content within a scrollable viewport.
Using the <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-type">scroll-snap-type</a> property on the relevant <a data-link-type="dfn" href="#scroll-container">scroll container</a>,
the author can request a particular bias
for the viewport to land on a valid <a data-link-type="dfn" href="#scroll-snap-position">snap position</a> after scrolling operations.</p>
<p>Valid <a data-link-type="dfn" href="#scroll-snap-position">snap positions</a> can be specified
as a particular alignment (<a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-align">scroll-snap-align</a>)
of an element’s <a data-link-type="dfn" href="#scroll-snap-margin">scroll snap margin</a> (<a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin">scroll-snap-margin</a>, defaulting to its margin box)
within the <a data-link-type="dfn" href="#scroll-container">scroll container</a>’s <a data-link-type="dfn" href="#snap-alignment-container">snap alignment container</a> (the rectangle obtained by reducing its visual viewport by its <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding">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 valid <a data-link-type="dfn" href="#scroll-snap-position">snap position</a>.</p>
<p><a data-link-type="dfn" href="#scroll-snap-position">Snap positions</a> must only affect the nearest ancestor
(on the element’s <a data-link-type="dfn">containing block chain</a>) <a data-link-type="dfn" href="#scroll-container">scroll container</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 data-dfn-type="dfn" data-export="" id="scroll-container">scroll container<a class="self-link" href="#scroll-container"></a></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.
<dt><dfn data-dfn-type="dfn" data-export="" id="snap-alignment-container">snap alignment container<a class="self-link" href="#snap-alignment-container"></a></dfn>
<dd>
A scroll container’s snap alignment container is the rectangle obtained by reducing its visual viewport by its <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding">scroll-snap-padding</a>.
<p class="issue" id="issue-1b6eda6b"><a class="self-link" href="#issue-1b6eda6b"></a>Better name for this concept?</p>
<dt><dfn data-dfn-type="dfn" data-export="" data-local-lt="snap margin" data-lt="scroll snap margin" id="scroll-snap-margin">snap margin<a class="self-link" href="#scroll-snap-margin"></a></dfn>
<dd> An element’s snap margin is the rectangle obtained by expanding its border box by its <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin">scroll-snap-margin</a>.
<dt><dfn data-dfn-type="dfn" data-export="" data-local-lt="snap position" data-lt="scroll snap position" id="scroll-snap-position">snap position<a class="self-link" href="#scroll-snap-position"></a></dfn>
<dd> For a scroll container, a particular value for its scroll offset is a snap position if when scrolled to that offset the visual viewport of the scroll container would align with a descendent element in the manner specified by the scroll snap properties.
</dl>
<h2 class="heading settled" data-level="5" id="scroll-snap-type"><span class="secno">5. </span><span class="content">Scroll Snap Types: the <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-type">scroll-snap-type</a> property</span><a class="self-link" href="#scroll-snap-type"></a></h2>
<p>The <span class="css">scroll-snap-type</span> property defines how strictly a <a data-link-type="dfn" href="#scroll-container">scroll container’s</a> visual viewport should rest on <a data-link-type="dfn" href="#scroll-snap-position">snap positions</a>. It intentionally does not specify nor mandate any precise animations or physics used to enforce those snap positions; this is left up to the user agent.</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>
<table class="def propdef" data-link-for-hint="scroll-snap-type">
<tbody>
<tr>
<th>Name:
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-type">scroll-snap-type<a class="self-link" href="#propdef-scroll-snap-type"></a></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
<tr>
<th>Initial:
<td>none
<tr>
<th>Applies to:
<td>all elements
<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>
<dl>
<dt><dfn class="css" data-dfn-for="scroll-snap-type" data-dfn-type="value" data-export="" id="valdef-scroll-snap-type-none">none<a class="self-link" href="#valdef-scroll-snap-type-none"></a></dfn>
<dd> The visual viewport of this <a data-link-type="dfn" href="#scroll-container">scroll container</a> must ignore snap positions.
<dt><dfn class="css" data-dfn-for="scroll-snap-type" data-dfn-type="value" data-export="" id="valdef-scroll-snap-type-mandatory">mandatory<a class="self-link" href="#valdef-scroll-snap-type-mandatory"></a></dfn>
<dd>
The visual viewport of this <a data-link-type="dfn" href="#scroll-container">scroll container</a> is guaranteed to rest on a snap position when there are no active scrolling operations. That is, it must come to rest on a snap position at the termination of a scroll, if a valid, reachable snap position exists. If no valid, reachable snap position exists then no snapping occurs.
<p>If the content changes such that the visual viewport would no longer rest on a snap position (e.g. content is added, moved, deleted, resized), the scroll offset must be modified to maintain alignment of the visual viewport with a snap position. If the visual viewport was already aligned with a snap position prior to the content change and that snap position still exists (e.g. its associated element was not deleted), that same snap position must be satisfied after the content change.</p>
<dt><dfn class="css" data-dfn-for="scroll-snap-type" data-dfn-type="value" data-export="" id="valdef-scroll-snap-type-proximity">proximity<a class="self-link" href="#valdef-scroll-snap-type-proximity"></a></dfn>
<dd>
The visual viewport of this <a data-link-type="dfn" href="#scroll-container">scroll container</a> may come to rest on 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 visual viewport would no longer rest on a snap position (e.g. content is added, moved, deleted, resized), the scroll offset may be modified to maintain alignment of the visual viewport with a snap position. If the visual viewport was already aligned with a snap position prior to the content change and that snap position still exists (e.g. its associated element was not deleted) and if the user agent elects to modify the scroll offset to maintain snap position alignment, that same snap position must be satisfied after the content change.</p>
</dl>
<h2 class="heading settled" data-level="6" id="scroll-snap-padding"><span class="secno">6. </span><span class="content">Scroll Snap Padding: the <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding">scroll-snap-padding</a> property</span><a class="self-link" href="#scroll-snap-padding"></a></h2>
<p>The <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding">scroll-snap-padding</a> property defines the <a data-link-type="dfn" href="#snap-alignment-container">snap alignment container</a>, a region inset from the visual viewport of a <a data-link-type="dfn" href="#scroll-container">scroll container</a> used in calculating its <a data-link-type="dfn" href="#scroll-snap-position">snap positions</a>. The snap alignment container is used as the alignment container when calculating valid <a data-link-type="dfn" href="#scroll-snap-position">snap positions</a>.</p>
<table class="def propdef" data-link-for-hint="scroll-snap-padding">
<tbody>
<tr>
<th>Name:
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-padding">scroll-snap-padding<a class="self-link" href="#propdef-scroll-snap-padding"></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"><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>scroll containers
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>relative to the scroll container’s visual viewport
<tr>
<th>Media:
<td>interactive
<tr>
<th>Computed value:
<td>as specified, with lengths made absolute
<tr>
<th>Animatable:
<td>yes
</table>
<dl>
<dt><dfn class="css" data-dfn-for="scroll-snap-padding" data-dfn-type="value" data-export="" id="valdef-scroll-snap-padding--length--percentage-1-4">[ <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value"><length></a> | <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#percentage-value"><percentage></a> ]{1,4}<a class="self-link" href="#valdef-scroll-snap-padding--length--percentage-1-4"></a></dfn>
<dd> Specifies the region inset from the visual viewport. 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 visual viewport.
</dl>
<p>This property is a shorthand property that sets all of the <a class="property" data-link-type="propdesc">scroll-snap-padding-*</a> longhands in one declaration.</p>
<h2 class="heading settled" data-level="7" id="scroll-snap-margin0"><span class="secno">7. </span><span class="content">Scroll Snap Margin: the <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin">scroll-snap-margin</a> property</span><a class="self-link" href="#scroll-snap-margin0"></a></h2>
<p>The <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-margin">scroll-snap-margin</a> property defines the <a data-link-type="dfn" href="#scroll-snap-margin">scroll snap margin</a> on elements within a <a data-link-type="dfn" href="#scroll-container">scroll container</a>, used in calculating <a data-link-type="dfn" href="#scroll-snap-position">snap positions</a> for that scroll container.</p>
<table class="def propdef" data-link-for-hint="scroll-snap-margin">
<tbody>
<tr>
<th>Name:
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-margin">scroll-snap-margin<a class="self-link" href="#propdef-scroll-snap-margin"></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"><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>all elements
<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>yes
</table>
<dl>
<dt><dfn class="css" data-dfn-for="scroll-snap-margin" data-dfn-type="value" data-export="" id="valdef-scroll-snap-margin-length1-4"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value"><length></a>{1,4}<a class="self-link" href="#valdef-scroll-snap-margin-length1-4"></a></dfn>
<dd>
Specifies the outset of the element’s snap margin from the axis-aligned bounding box of the transformed border box, in the <a data-link-type="dfn" href="#scroll-container">scroll container’s</a> coordinate space. Outsets are applied to this bounding box, not the border box.
<p class="note" role="note">Note: This ensures that the <a data-link-type="dfn" href="#scroll-snap-margin">scroll snap margin</a> is always rectangular and axis-aligned to the <a data-link-type="dfn" href="#scroll-container">scroll container’s</a> coordinate space.</p>
</dl>
<p>This property is a shorthand property that sets all of the <a class="property" data-link-type="propdesc">scroll-snap-margin-*</a> longhands in one declaration.</p>
<h2 class="heading settled" data-level="8" id="scroll-snap-align"><span class="secno">8. </span><span class="content">Scroll Snap Align: the <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-align">scroll-snap-align</a> property</span><a class="self-link" href="#scroll-snap-align"></a></h2>
<p>The <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-align">scroll-snap-align</a> property specifies how a scroll container’s region specified by <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding">scroll-snap-padding</a> should align with descendent elements' scroll snap margin. 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>
<table class="def propdef" data-link-for-hint="scroll-snap-align">
<tbody>
<tr>
<th>Name:
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-scroll-snap-align">scroll-snap-align<a class="self-link" href="#propdef-scroll-snap-align"></a></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>all elements
<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>
<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">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> The scroll offset which aligns the start edge of this box’s scroll snap margin with the start edge of its ancestor scroll container’s region defined by <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding">scroll-snap-padding</a> in the specified axis is a <a data-link-type="dfn" href="#scroll-snap-position">snap position</a> in that 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> The scroll offset which aligns the end edge of this box’s scroll snap margin with the end edge of its ancestor scroll container’s region defined by <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding">scroll-snap-padding</a> in the specified axis is a <a data-link-type="dfn" href="#scroll-snap-position">snap position</a> in that 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> The scroll offset which aligns the center of this box’s scroll snap margin with the center of its ancestor scroll container’s region defined by <a class="property" data-link-type="propdesc" href="#propdef-scroll-snap-padding">scroll-snap-padding</a> in the specified axis is a <a data-link-type="dfn" href="#scroll-snap-position">snap position</a> in that axis.
</dl>
<h2 class="no-num heading settled" id="acknowledgments"><span class="content">Acknowledgments</span><a class="self-link" href="#acknowledgments"></a></h2>
<p>Many thanks to lots of people for their proposals and recommendations, some of which are 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>
<h3 class="heading settled" id="conform-classes"><span class="content"> Conformance classes</span><a class="self-link" href="#conform-classes"></a></h3>
<p>Conformance to this specification
is defined for three conformance classes: </p>
<dl>
<dt>style sheet
<dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#style-sheet">CSS
style sheet</a>.
<dt>renderer
<dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that interprets the semantics of a style sheet and renders
documents that use them.
<dt>authoring tool
<dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that writes a style sheet.
</dl>
<p>A style sheet is conformant to this specification
if all of its statements that use syntax defined in this module are valid
according to the generic CSS grammar and the individual grammars of each
feature defined in this module. </p>
<p>A renderer is conformant to this specification
if, in addition to interpreting the style sheet as defined by the
appropriate specifications, it supports all the features defined
by this specification by parsing them correctly
and rendering the document accordingly. However, the inability of a
UA to correctly render a document due to limitations of the device
does not make the UA non-conformant. (For example, a UA is not
required to render color on a monochrome monitor.) </p>
<p>An authoring tool is conformant to this specification
if it writes style sheets that are syntactically correct according to the
generic CSS grammar and the individual grammars of each feature in
this module, and meet all other conformance requirements of style sheets
as described in this module. </p>
<h3 class="heading settled" id="conform-responsible"><span class="content"> Requirements for Responsible Implementation of CSS</span><a class="self-link" href="#conform-responsible"></a></h3>
<p>The following sections define several conformance requirements
for implementing CSS responsibly,
in a way that promotes interoperability in the present and future. </p>
<h4 class="heading settled" id="conform-partial"><span class="content"> Partial Implementations</span><a class="self-link" href="#conform-partial"></a></h4>
<p>So that authors can exploit the forward-compatible parsing rules to assign fallback values, <strong>CSS renderers <em>must</em> treat as invalid
(and <a href="http://www.w3.org/TR/CSS2/conform.html#ignore">ignore as appropriate</a>)
any at-rules, properties, property values, keywords, and other syntactic constructs
for which they have no usable level of support</strong>.
In particular, user agents <em>must not</em> selectively ignore
unsupported property values and honor supported values in a single multi-value property declaration:
if any value is considered invalid (as unsupported values must be),
CSS requires that the entire declaration be ignored. </p>
<h4 class="heading settled" id="conform-future-proofing"><span class="content"> Implementations of Unstable and Proprietary Features</span><a class="self-link" href="#conform-future-proofing"></a></h4>
<p>To avoid clashes with future stable CSS features,
the CSSWG recommends <a href="http://www.w3.org/TR/CSS/#future-proofing">following best practices</a> for the implementation of <a href="http://www.w3.org/TR/CSS/#unstable">unstable</a> features and <a href="http://www.w3.org/TR/CSS/#proprietary-extension">proprietary extensions</a> to CSS. </p>
<h4 class="heading settled" id="conform-testing"><span class="content"> Implementations of CR-level Features</span><a class="self-link" href="#conform-testing"></a></h4>
<p>Once a specification reaches the Candidate Recommendation stage,
implementers should release an <a data-link-type="dfn" href="http://www.w3.org/TR/CSS/#vendor-prefix">unprefixed</a> implementation
of any CR-level feature they can demonstrate
to be correctly implemented according to spec,
and should avoid exposing a prefixed variant of that feature. </p>
<p>To establish and maintain the interoperability of CSS across
implementations, the CSS Working Group requests that non-experimental
CSS renderers submit an implementation report (and, if necessary, the
testcases used for that implementation report) to the W3C before
releasing an unprefixed implementation of any CSS features. Testcases
submitted to W3C are subject to review and correction by the CSS
Working Group. </p>
<p>Further information on submitting testcases and implementation reports
can be found from on the CSS Working Group’s website at <a href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>.
Questions should be directed to the <a href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a> mailing list. </p>
<h2 class="no-num heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2>
<h3 class="no-num heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3>
<ul class="index">
<li><a href="#valdef-scroll-snap-align-center">center</a><span>, in §8</span>
<li><a href="#valdef-scroll-snap-align-end">end</a><span>, in §8</span>
<li><a href="#valdef-scroll-snap-margin-length1-4"><length>{1,4}</a><span>, in §7</span>
<li><a href="#valdef-scroll-snap-padding--length--percentage-1-4">[ <length> | <percentage> ]{1,4}</a><span>, in §6</span>
<li><a href="#valdef-scroll-snap-type-mandatory">mandatory</a><span>, in §5</span>
<li>
none
<ul>
<li><a href="#valdef-scroll-snap-type-none">value for scroll-snap-type</a><span>, in §5</span>
<li><a href="#valdef-scroll-snap-align-none">value for scroll-snap-align</a><span>, in §8</span>
</ul>
<li><a href="#valdef-scroll-snap-type-proximity">proximity</a><span>, in §5</span>
<li><a href="#scroll-container">scroll container</a><span>, in §4</span>
<li><a href="#propdef-scroll-snap-align">scroll-snap-align</a><span>, in §8</span>
<li><a href="#scroll-snap-margin">scroll snap margin</a><span>, in §4</span>
<li><a href="#propdef-scroll-snap-margin">scroll-snap-margin</a><span>, in §7</span>
<li><a href="#propdef-scroll-snap-padding">scroll-snap-padding</a><span>, in §6</span>
<li><a href="#scroll-snap-position">scroll snap position</a><span>, in §4</span>
<li><a href="#propdef-scroll-snap-type">scroll-snap-type</a><span>, in §5</span>
<li><a href="#snap-alignment-container">snap alignment container</a><span>, in §4</span>
<li><a href="#scroll-snap-margin">snap margin</a><span>, in §4</span>
<li><a href="#scroll-snap-position">snap position</a><span>, in §4</span>
<li><a href="#valdef-scroll-snap-align-start">start</a><span>, in §8</span>
</ul>
<h3 class="no-num heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3>
<ul class="index">
<li>
<a data-link-type="biblio" href="#biblio-css-align-3">[css-align-3]</a> defines the following terms:
<ul>
<li><a href="https://drafts.csswg.org/css-align-3/#alignment-container">alignment container</a>
<li><a href="https://drafts.csswg.org/css-align-3/#alignment-subject">alignment subject</a>
</ul>
<li>
<a data-link-type="biblio" href="#biblio-css-pseudo-4">[css-pseudo-4]</a> defines the following terms:
<ul>
<li><a href="https://drafts.csswg.org/css-pseudo-4/#selectordef-first-letter">::first-letter</a>
<li><a href="https://drafts.csswg.org/css-pseudo-4/#selectordef-first-line">::first-line</a>
</ul>
<li>
<a data-link-type="biblio" href="#biblio-css-values-3">[css-values]</a> defines the following terms:
<ul>
<li><a href="https://drafts.csswg.org/css-values-3/#length-value"><length></a>
<li><a href="https://drafts.csswg.org/css-values-3/#percentage-value"><percentage></a>
<li><a href="https://drafts.csswg.org/css-values-3/#mult-num-range">{a,b}</a>
<li><a href="https://drafts.csswg.org/css-values-3/#comb-one">|</a>
</ul>
<li>
<a data-link-type="biblio" href="#biblio-css21">[CSS21]</a> defines the following terms:
<ul>
<li><a href="https://drafts.csswg.org/css2/box.html#propdef-padding">padding</a>
</ul>
</ul>
<h2 class="no-num heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2>
<h3 class="no-num heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3>
<dl>
<dt id="biblio-css21"><a class="self-link" href="#biblio-css21"></a>[CSS21]
<dd>Bert Bos; et al. <a href="http://www.w3.org/TR/CSS2">Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification</a>. 7 June 2011. REC. URL: <a href="http://www.w3.org/TR/CSS2">http://www.w3.org/TR/CSS2</a>
<dt id="biblio-css-align-3"><a class="self-link" href="#biblio-css-align-3"></a>[CSS-ALIGN-3]
<dd>Elika Etemad; Tab Atkins Jr.. <a href="http://www.w3.org/TR/css-align-3/">CSS Box Alignment Module Level 3</a>. 18 December 2014. WD. URL: <a href="http://www.w3.org/TR/css-align-3/">http://www.w3.org/TR/css-align-3/</a>
<dt id="biblio-css-pseudo-4"><a class="self-link" href="#biblio-css-pseudo-4"></a>[CSS-PSEUDO-4]
<dd>Daniel Glazman; Elika Etemad; Alan Stearns. <a href="http://www.w3.org/TR/css-pseudo-4/">CSS Pseudo-Elements Module Level 4</a>. 15 January 2015. WD. URL: <a href="http://www.w3.org/TR/css-pseudo-4/">http://www.w3.org/TR/css-pseudo-4/</a>
<dt id="biblio-css-values"><a class="self-link" href="#biblio-css-values"></a>[CSS-VALUES]
<dd>Tab Atkins Jr.; Elika Etemad. <a href="http://www.w3.org/TR/css-values/">CSS Values and Units Module Level 3</a>. 11 June 2015. CR. URL: <a href="http://www.w3.org/TR/css-values/">http://www.w3.org/TR/css-values/</a>
<dt id="biblio-rfc2119"><a class="self-link" href="#biblio-rfc2119"></a>[RFC2119]
<dd>S. Bradner. <a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a>
</dl>
<h3 class="no-num heading settled" id="informative"><span class="content">Informative References</span><a class="self-link" href="#informative"></a></h3>
<dl>
<dt id="biblio-css3val"><a class="self-link" href="#biblio-css3val"></a>[CSS3VAL]
<dd>Tab Atkins Jr.; Elika Etemad. <a href="http://www.w3.org/TR/css-values/">CSS Values and Units Module Level 3</a>. 11 June 2015. CR. URL: <a href="http://www.w3.org/TR/css-values/">http://www.w3.org/TR/css-values/</a>
</dl>
<h2 class="no-num heading settled" id="property-index"><span class="content">Property Index</span><a class="self-link" href="#property-index"></a></h2>
<div class="big-element-wrapper">
<table class="index">
<thead>
<tr>
<th scope="col">Name
<th scope="col">Value
<th scope="col">Initial
<th scope="col">Applies to
<th scope="col">Inh.
<th scope="col">%ages
<th scope="col">Media
<th scope="col">Animatable
<th scope="col">Computed value
<tbody>
<tr>
<th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-type">scroll-snap-type</a>
<td>none | mandatory | proximity
<td>none
<td>all elements
<td>no
<td>n/a
<td>interactive
<td>no
<td>as specified
<tr>
<th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-padding">scroll-snap-padding</a>
<td>[ <length> | <percentage> ]{1,4}
<td>0
<td>scroll containers
<td>no
<td>relative to the scroll container’s visual viewport
<td>interactive
<td>yes
<td>as specified, with lengths made absolute
<tr>
<th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-margin">scroll-snap-margin</a>
<td><length>{1,4}
<td>0
<td>all elements
<td>no
<td>n/a
<td>interactive
<td>yes
<td>as specified, with lengths made absolute
<tr>
<th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-snap-align">scroll-snap-align</a>
<td>[ none | start | end | center ]{1,2}
<td>none
<td>all elements
<td>no
<td>n/a
<td>interactive
<td>no
<td>two keywords
</table>
</div>
<h2 class="no-num heading settled" id="issues-index"><span class="content">Issues Index</span><a class="self-link" href="#issues-index"></a></h2>
<div style="counter-reset:issue">
<div class="issue"> <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> <a href="#issue-752e30a5"> ↵ </a></div>
<div class="issue">Better name for this concept?<a href="#issue-1b6eda6b"> ↵ </a></div>
<div class="issue"> <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. <a href="#issue-7e0cf181"> ↵ </a></div>
<div class="issue"> 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). <a href="#issue-f7391e31"> ↵ </a></div>
</div>
</body>
</html>