-
Notifications
You must be signed in to change notification settings - Fork 790
Expand file tree
/
Copy pathOverview.html
More file actions
1897 lines (1882 loc) · 155 KB
/
Overview.html
File metadata and controls
1897 lines (1882 loc) · 155 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
77FB
div>
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 Round Display 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">
<meta content="Motion paths allow authors to animate any graphical object along an author specified path." name="abstract">
<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 */
body {
counter-reset: example figure issue;
}
.issue {
counter-increment: issue;
}
.issue:not(.no-marker)::before {
content: "Issue " counter(issue);
}
.example {
counter-increment: example;
}
.example:not(.no-marker)::before {
content: "Example " counter(example);
}
.invalid.example:not(.no-marker)::before,
.illegal.example:not(.no-marker)::before {
content: "Invalid Example" counter(example);
}
figure {
counter-increment: figure;
}
figcaption:not(.no-marker)::before {
content: "Figure " counter(figure);
}</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 {
position: absolute;
z-index: 35;
height: auto;
width: -webkit-fit-content;
width: 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 ul { padding: 0; }
.dfn-panel li { list-style: inside; }
.dfn-panel.activated {
display: inline-block;
position: fixed;
left: .5em;
bottom: 2em;
margin: 0 auto;
max-width: calc(100vw - 1.5em - .4em - .5em);
max-height: 30vh;
}
.dfn-paneled { cursor: pointer; }
</style>
<style>/* style-syntax-highlighting */
.highlight:not(.idl) { 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; }
.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: #222222 } /* 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 */
</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>CSS Round Display 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-06-20">20 June 2016</time></span></h2>
<div data-fill-with="spec-metadata">
<dl>
<dt>This version:
9E61
<dd><a class="u-url" href="https://drafts.csswg.org/css-round-display/">https://drafts.csswg.org/css-round-display/</a>
<dt>Latest published version:
<dd><a href="https://www.w3.org/TR/css-round-display-1/">https://www.w3.org/TR/css-round-display-1/</a>
<dt>Previous Versions:
<dd><a href="https://www.w3.org/TR/2016/WD-css-round-display-1-20160301/" rel="previous">https://www.w3.org/TR/2016/WD-css-round-display-1-20160301/</a>
<dd><a href="https://www.w3.org/TR/2015/WD-css-round-display-1-20150922/" rel="previous">https://www.w3.org/TR/2015/WD-css-round-display-1-20150922/</a>
<dt>Issue Tracking:
<dd><a href="https://github.com/w3c/csswg-drafts/issues/">GitHub</a>
<dd><a href="#issues-index">Inline In Spec</a>
<dt class="editor">Editors:
<dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:hyojin22.song@lge.com">Hyojin Song</a> (<span class="p-org org">LG Electronics</span>)
<dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:jh.hong@lge.com">Jihye Hong</a> (<span class="p-org org">LG Electronics</span>)
<dt class="editor">Former Editor:
<dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:soonbo.han@lge.com">Soonbo Han</a> (<span class="p-org org">LG Electronics</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>Motion paths allow authors to animate any graphical object along an author specified path.</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> <a href="https://github.com/w3c/csswg-drafts/issues">GitHub Issues</a> are preferred for discussion of this specification.
When filing an issue, please put the text “css-round-display” in the title,
preferably like this:
“[css-round-display] <em>…summary of comment…</em>”.
All issues and comments are <a href="https://lists.w3.org/Archives/Public/public-css-archive/">archived</a>,
and there is also a <a href="http://lists.w3.org/Archives/Public/www-style/">historical archive</a>. </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="#introduction"><span class="secno">1</span> <span class="content">Introduction</span></a>
<li><a href="#terminology"><span class="secno">2</span> <span class="content">Terminology</span></a>
<li>
<a href="#extending-media-queries"><span class="secno">3</span> <span class="content">Extending Media Queries for a round display</span></a>
<ol class="toc">
<li><a href="#shape-media-feature"><span class="secno">3.1</span> <span class="content">The <span class="property">shape</span> media feature</span></a>
</ol>
<li>
<a href="#extending-viewport-rule"><span class="secno">4</span> <span class="content">Extending the @viewport rule</span></a>
<ol class="toc">
<li><a href="#viewport-fit-descriptor"><span class="secno">4.1</span> <span class="content">The <span class="property">viewport-fit</span> descriptor</span></a>
</ol>
<li>
<a href="#aligning-content"><span class="secno">5</span> <span class="content">Aligning content along the display border</span></a>
<ol class="toc">
<li><a href="#shape-inside-property"><span class="secno">5.1</span> <span class="content">The <span class="property">shape-inside</span> property</span></a>
</ol>
<li>
<a href="#drawing-borders"><span class="secno">6</span> <span class="content">Drawing borders around the display border</span></a>
<ol class="toc">
<li><a href="#border-boundary-property"><span class="secno">6.1</span> <span class="content">The <span class="property">border-boundary</span> property</span></a>
</ol>
<li>
<a href="#positioning-content"><span class="secno">7</span> <span class="content">Position the element along the path</span></a>
<ol class="toc">
<li><a href="#offset-path-property"><span class="secno">7.1</span> <span class="content">Define the path: The <span class="property">offset-path</span> property</span></a>
<li><a href="#offset-position-property"><span class="secno">7.2</span> <span class="content">Define the initial position of the path: The <span class="property">offset-position</span> property</span></a>
<li><a href="#offset-distance-property"><span class="secno">7.3</span> <span class="content">Position on the path: The <span class="property">offset-distance</span> property</span></a>
<li><a href="#offset-anchor-property"><span class="secno">7.4</span> <span class="content">The anchor of the element: The <span class="property">offset-anchor</span> property</span></a>
<li><a href="#offset-rotation-property"><span class="secno">7.5</span> <span class="content">Rotation at point: The <span class="property">offset-rotation</span> property</span></a>
<li>
<a href="#position-processing"><span class="secno">7.6</span> <span class="content">Position processing</span></a>
<ol class="toc">
<li><a href="#calculating-the-computed-distance-along-a-path"><span class="secno">7.6.1</span> <span class="content">Calculating the computed distance along a path</span></a>
<li><a href="#calculating-path-transform"><span class="secno">7.6.2</span> <span class="content">Calculating the path transform</span></a>
</ol>
</ol>
<li><a href="#usecases"><span class="secno">8</span> <span class="content"> Use Cases</span></a>
<li>
<a href="#changes"><span class="secno">9</span> <span class="content"> Changes</span></a>
<ol class="toc">
<li><a href="#changes_from_Sep_22_2015"><span class="secno">9.1</span> <span class="content"> Changes from <span>September 22<sup>th</sup> 2015</span> version</span></a>
</ol>
<li><a href="#acks"><span class="secno"></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=&q
6D5F
uot;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>
<ol class="toc">
<li><a href="#media-descriptor-table"><span class="secno"></span> <span class="content"><span>@media</span> Descriptors</span></a>
<li><a href="#viewport-descriptor-table"><span class="secno"></span> <span class="content"><span>@viewport</span> Descriptors</span></a>
</ol>
<li><a href="#issues-index"><span class="secno"></span> <span class="content">Issues Index</span></a>
</ol>
</nav>
<main>
<h2 class="heading settled" data-level="1" id="introduction"><span class="secno">1. </span><span class="content">Introduction</span><a class="self-link" href="#introduction"></a></h2>
<p> Conventionally, web pages have been shown through a rectangular screen such as PC, tablet, and smart phone. The window content area in a web browser is a rectangle. Each HTML element follows the W3C box model and thus is also a rectangle. <br> Nowadays, devices come in varied shapes of the displays.
It needs to consider the shape of the display when implementing web pages on devices.
However, current web standards lack some features to support the devices as follows: </p>
<ol>
<li>Lack of the capability to detect the shape of a display
<li>Lack of layout mechanisms suitable for the shape of a display
</ol>
In order to facilitate the use of the web especially on a round display, there could be some features to support it.
<p></p>
<p> The <a class="property" data-link-type="propdesc">device-radius</a> media feature is added to Media Queries.
Current user agents are not capable of detecting the shape of a display so that authors cannot apply various layouts for a round display. To resolve the issue, <a class="property" data-link-type="propdesc">device-radius</a> informs the web page of the property regarding the shape of the display. <br><br> To apply the shape of a display to content area, we extend the <a class="property" data-link-type="propdesc" href="#propdef-shape-inside" id="ref-for-propdef-shape-inside-1">shape-inside</a> property of CSS Shapes. The position of the element which is overflowed from the display is adjusted inside the display when using this property even if the authors don’t know the exact shape of the display. <br><br> We also add the <a class="property" data-link-type="propdesc" href="#propdef-border-boundary" id="ref-for-propdef-border-boundary-1">border-boundary</a> property to CSS Borders. The borders of the element can be drawn along the edge of the display even if the element is overflowed. <br><br> For the better web design suitable for a round display, we introduce polar positioning.
In conventional positioning method, the Cartesian coordinates, elements are positioned by offsets in x-axis and y-axis. But, we suggest a method to position elements with specifying the distance and angle from the origin point of coordinates. </p>
<p>This module provides features such as:</p>
<ul>
<li data-md="">
<p>Detecting the rounded display</p>
<li data-md="">
<p>Aligning contents in the display’s shape</p>
<li data-md="">
<p>Drawing borders along the display’s edge</p>
<li data-md="">
<p>Positioning elements in polar coordinates</p>
</ul>
<p></p>
<h2 class="heading settled" data-level="2" id="terminology"><span class="secno">2. </span><span class="content">Terminology</span><a class="self-link" href="#terminology"></a></h2>
This specification follows the CSS property definition conventions from <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a>. <br> The detailed description of Media Queries is defined in <a data-link-type="biblio" href="#biblio-mediaqueries-4">[MEDIAQUERIES-4]</a><br> The detailed description of CSS Shapes is defined in <a data-link-type="biblio" href="#biblio-css-shapes-1">[CSS-SHAPES-1]</a><br> The detailed description of Borders is defined in <a data-link-type="biblio" href="#biblio-css3-border">[CSS3-BORDER]</a><br> The detailed description of Positioned Layout is defined in <a data-link-type="biblio" href="#biblio-css3-positioning">[CSS3-POSITIONING]</a><br>
<h2 class="heading settled" data-level="3" id="extending-media-queries"><span class="secno">3. </span><span class="content">Extending Media Queries for a round display</span><a class="self-link" href="#extending-media-queries"></a></h2>
<p>Media Queries <a data-link-type="biblio" href="#biblio-mediaqueries-4">[MEDIAQUERIES-4]</a> define mechanisms to support media-dependent style sheets, tailored for different environments. We propose to extend Media Queries by adding the shape media feature to support various types of displays. This will allow web authors to apply different styles to a web page on the rounded display.</p>
<h3 class="heading settled" data-level="3.1" id="shape-media-feature"><span class="secno">3.1. </span><span class="content">The <a class="property" data-link-type="propdesc" href="#descdef-media-shape" id="ref-for-descdef-media-shape-1">shape</a> media feature</span><a class="self-link" href="#shape-media-feature"></a></h3>
To use different style sheets for a rectangle display and for a round display, media queries should support some properties to identify the display shape.
<table class="def descdef mq">
<tbody>
<tr>
<th>Name:
<td><dfn class="dfn-paneled css" data-dfn-for="@media" data-dfn-type="descriptor" data-export="" id="descdef-media-shape">shape</dfn>
<tr>
<th>For:
<td><a class="css" data-link-type="at-rule" href="https://drafts.csswg.org/css-conditional-3/#at-ruledef-media">@media</a>
<tr>
<th>Value:
<td class="prod">rect <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> round
<tr>
<th>Type:
<td>discrete
</table>
<p class="note" role="note"> Note: To define a <a class="property" data-link-type="propdesc">discrete</a> type media feature, the feature is evaluated in a boolean context. </p>
<p>The <a class="property" data-link-type="propdesc" href="#descdef-media-shape" id="ref-for-descdef-media-shape-2">shape</a> media feature describes the general shape of the targeted display area of the output device. It accepts the following values:</p>
<dl>
<dt><dfn class="css" data-dfn-for="@media/shape" data-dfn-type="value" data-export="" id="valdef-media-shape-rect">rect<a class="self-link" href="#valdef-media-shape-rect"></a></dfn>
<dd> The shape is an axis aligned rectangle or square, or a similar shape for which the traditional designs are appropriate.
<dt><dfn class="css" data-dfn-for="@media/shape" data-dfn-type="value" data-export="" id="valdef-media-shape-round">round<a class="self-link" href="#valdef-media-shape-round"></a></dfn>
<dd> The shape is rounded or a similar shape to the circle such as an oval, an ellipse for which distinctively rounded designs are appropriate.
</dl>
<div class="example" id="example-1ccfc67b">
<a class="self-link" href="#example-1ccfc67b"></a> The example below shows how a web page looks in the different shapes of displays.
This is a simple clock written in HTML without <a class="property" data-link-type="propdesc" href="#descdef-media-shape" id="ref-for-descdef-media-shape-3">shape</a>.
<pre class="lang-html highlight"><span></span><span class="cp"><!DOCTYPE html></span>
<span class="p"><</span><span class="nt">html</span><span class="p">></span>
<span class="p"><</span><span class="nt">head</span><span class="p">></span>
<span class="p"><</span><span class="nt">link</span> <span class="na">rel</span><span class="o">=</span><span class="s">"stylesheet"</span> <span class="na">href</span><span class="o">=</span><span class="s">"rectangle.css"</span> <span class="p">/></span>
<span class="p"></</span><span class="nt">
8096
head</span><span class="p">></span>
<span class="p"><</span><span class="nt">body</span><span class="p">></span>
<span class="p"><</span><span class="nt">div</span> <span class="na">id</span><span class="o">=</span><span class="s">"clockLayer"</span><span class="p">></span>
<span class="p"><</span><span class="nt">div</span> <span class="na">id</span><span class="o">=</span><span class="s">"clockLayer"</span><span class="p">></span>
<span class="p"><</span><span class="nt">div</span> <span class="na">id</span><span class="o">=</span><span class="s">"date"</span><span class="p">></span>2015/02/28 (SAT)<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">id</span><span class="o">=</span><span class="s">"time"</span><span class="p">></span>10:11<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">id</span><span class="o">=</span><span class="s">"weather"</span><span class="p">><</span><span class="nt">img</span> <span class="na">src</span><span class="o">=</span><span class="s">"cloudy.png"</span> <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>
<span class="p"></</span><span class="nt">div</span><span class="p">></span>
<span class="p"></</span><span class="nt">body</span><span class="p">></span>
<span class="p"></</span><span class="nt">html</span><span class="p">></span>
</pre>
<div class="figure">
<div style="height: 350px">
<div style="float: left; width: 250px;">
<img alt="An image of a rectangle clock within a rectangle display" src="images/device_radius_clock_a.png">
<p>(A) Rectangle Display</p>
</div>
<div style="float: right; width: 250px;">
<img alt="An image of a round clock within a rectangle display" src="images/device_radius_clock_b.png">
<p>(B) Round Display</p>
</div>
</div>
<figcaption> Devices where the <a class="property" data-link-type="propdesc" href="#descdef-media-shape" id="ref-for-descdef-media-shape-4">shape</a> media feature is applicable </figcaption>
</div>
<p>On the other hand, the example below shows how the ‘shape’ media feature works in the different shapes of displays. This is the same as the code above except for media queries usage. The shape media feature can be used as follows:</p>
<pre class="lang-html highlight"><span></span><span class="c"><!-- index.html --></span>
<span class="p"><</span><span class="nt">head</span><span class="p">></span>
<span class="p"><</span><span class="nt">link</span> <span class="na">media</span><span class="o">=</span><span class="s">"screen and (shape: rect)"</span> <span class="na">rel</span><span class="o">=</span><span class="s">"stylesheet"</span> <span class="na">href</span><span class="o">=</span><span class="s">"rectangle.css"</span> <span class="p">/></span>
<span class="p"><</span><span class="nt">link</span> <span class="na">media</span><span class="o">=</span><span class="s">"screen and (shape: round)"</span> <span class="na">rel</span><span class="o">=</span><span class="s">"stylesheet"</span> <span class="na">href</span><span class="o">=</span><span class="s">"round.css"</span> <span class="p">/></span>
<span class="p"></</span><span class="nt">head</span><span class="p">></span>
</pre>
<p>If this example code is loaded in a round display, 'round.css' will be applied by the media queries mechanism.</p>
<div class="figure">
<div style="height: 350px">
<div style="float: left; width: 250px;">
<img alt="An image of a rectangle clock within a rectangle display" src="images/device_radius_clock_a.png">
<p>(A) Rectangle Display<br>(w/ <code>shape: rect</code>)</p>
</div>
<div style="float: right; width: 250px;">
<img alt="An image of a round clock within a round display" src="images/device_radius_clock_c.png">
<p>(B) Round Display<br>(w/ <code>shape: round</code>)</p>
</div>
</div>
<figcaption> Devices where the <a class="property" data-link-type="propdesc" href="#descdef-media-shape" id="ref-for-descdef-media-shape-5">shape</a> media feature is applicable </figcaption>
</div>
</div>
<p class="note" role="note">Note: There are cases when the UA may know the shape even in the absence of OS APIs. For example, when rendering to PDF, the shape is known to be a rectangle, so 'shape: rect' evaluates to <span class="css">true</span> while <a class="css" data-link-type="propdesc" href="#descdef-media-shape" id="ref-for-descdef-media-shape-6">shape: round</a> to <span class="css">false</span> </p>
<p class="note" role="note">Note: For other shapes, such as polygons, we need to extend the media features with additional parameters. The current features have limitations to support the diversity beyond round shapes. How can we express star-shaped polygons? (e.g. SVG syntax, etc.) Of course, there is a trade-off between simplicity and expressiveness. </p>
<h2 class="heading settled" data-level="4" id="extending-viewport-rule"><span class="secno">4. </span><span class="content">Extending the @viewport rule</span><a class="self-link" href="#extending-viewport-rule"></a></h2>
<h3 class="heading settled" data-level="4.1" id="viewport-fit-descriptor"><span class="secno">4.1. </span><span class="content">The <a class="property" data-link-type="propdesc" href="#descdef-viewport-viewport-fit" id="ref-for-descdef-viewport-viewport-fit-1">viewport-fit</a> descriptor</span><a class="self-link" href="#viewport-fit-descriptor"></a></h3>
<p><a class="property" data-link-type="propdesc" href="#descdef-viewport-viewport-fit" id="ref-for-descdef-viewport-viewport-fit-2">viewport-fit</a> can set the size of the initial viewport <a data-link-type="biblio" href="#biblio-css-device-adapt">[css-device-adapt]</a>.</p>
<table class="def descdef">
<tbody>
<tr>
<th>Name:
<td><dfn class="dfn-paneled css" data-dfn-for="@viewport" data-dfn-type="descriptor" data-export="" id="descdef-viewport-viewport-fit">viewport-fit</dfn>
<tr>
<th>For:
<td><a class="css" data-link-type="at-rule" href="https://drafts.csswg.org/css-device-adapt-1/#at-ruledef-viewport">@viewport</a>
<tr>
<th>Value:
<td class="prod">auto <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> contain <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> cover
<tr>
<th>Initial:
<td>auto
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual, continuous
<tr>
<th>Computed value:
<td>as specified
</table>
<p>The initial viewport is seen through the physical screen of the device. On rounded screen, the part of the page that’s currently shown on-screen is round but the viewport is rectangular. Because of this, some part of the page is clipped.</p>
<div class="figure">
<img alt="An image of the clipped area between the viewport bounding box and the device’s border" src="images/viewport_clipped_area.png" style="width: 250px">
<figcaption> Clipped area </figcaption>
</div>
<p><a class="property" data-link-type="propdesc" href="#descdef-viewport-viewport-fit" id="ref-for-descdef-viewport-viewport-fit-3">viewport-fit</a> can control the clipped area by setting the size of the initial viewport as changing with the size of the window or viewing area.</p>
<p>Values have the following meanings:</p>
<dl>
<dt><var><a class="property" data-link-type="propdesc">auto</a></var>
<dd> This value doesn’t affect the initial viewport, and the whole web page is viewable. UA can do anything it wants for the reader to view the web page easily.
<dt><dfn class="css" data-dfn-for="viewport-fit" data-dfn-type="value" data-export="" id="valdef-viewport-fit-contain">contain<a class="self-link" href="#valdef-viewport-fit-contain"></a></dfn>
<dd> The initial viewport is the largest rectangle which is inscribed in the display of the device. With this value, 'border-boundary: display' and 'shape-inside: display' have no effect. UA can paint the area which is outside the contained viewport for ‘contain’.
<dt><dfn class="css" data-dfn-for="viewport-fit" data-dfn-type="value" data-export="" id="valdef-viewport-fit-cover">cover<a class="self-link" href="#valdef-viewport-fit-cover"></a></dfn>
<dd> The initial viewport is the circumscribed rectangle of the physical screen of the device.
</dl>
<p>When setting the size of the bounding box for the viewport on the non-rectangular display, we have to consider the factors like below:</p>
<ul>
<li>Clipped area which is caused because the area of the viewport bounding box is larger than the area of the display
<li>Gap between the bounding box for the viewport and the area of the display
</ul>
<p>The author can decide which factor is more critical than another.
If it have to be guaranteed that any part of the web page isn’t hidden, avoiding clipping is more important than having a gap between the bounding box of the viewport and the border of the screen. If the author doesn’t want web pages to be small for the readability, then it would be better to set ‘viewport-fit’ as ‘cover’ and to implement pages with considering the clipped parts.</p>
<div class="example" id="example-45bbcbaf">
<a class="self-link" href="#example-45bbcbaf"></a>
<p>This example shows the size of the bounding box for the viewport specified with <a class="property" data-link-type="propdesc" href="#descdef-viewport-viewport-fit" id="ref-for-descdef-viewport-viewport-fit-4">viewport-fit</a> on the rounded display.</p>
<p>When the <a class="property" data-link-type="propdesc" href="#descdef-viewport-viewport-fit" id="ref-for-descdef-viewport-viewport-fit-5">viewport-fit</a> is specified with contain, the initial viewport is applied to the largest inscribed rectangle of the display.</p>
<pre class="lang-css highlight"><span></span><span class="n">@viewport</span> <span class="p">(</span>viewport-fit<span class="nt">: contain) </span><span class="p">{</span>
<span class="c">/* CSS for the rectangular design */</span>
<span class="p">}</span>
</pre>
<div class="figure">
<img alt="An image about the viewport applied to the bounding box specified with 'viewport-fit: contain'" src="images/viewport_fit_contain.png" style="width: 300px; text-align: center">
<figcaption> With '<code>viewport-fit: contain</code>' </figcaption>
</div>
<p>When cover is given to the <a class="property" data-link-type="propdesc" href="#descdef-viewport-viewport-fit" id="ref-for-descdef-viewport-viewport-fit-6">viewport-fit</a>, the initial viewport is applied to the circumscribed rectangle of the display.</p>
<pre class="lang-css highlight"><span></span><span class="n">@viewport</span> <span class="p">(</span>viewport-fit<span class="nt">: cover) </span><span class="p">{</span>
<span class="c">/* CSS for the rectangular design */</span>
<span class="p">}</span>
</pre>
<div class="figure">
<img alt="An image about the viewport applied to the bounding box specified with 'viewport-fit: cover'" src="images/viewport_fit_cover.png" style="width: 300px; text-align: center">
<figcaption> With '<code>viewport-fit: cover</code>' </figcaption>
</div>
</div>
<h2 class="heading settled" data-level="5" id="aligning-content"><span class="secno">5. </span><span class="content">Aligning content along the display border</span><a class="self-link" href="#aligning-content"></a></h2>
<h3 class="heading settled" data-level="5.1" id="shape-inside-property"><span class="secno">5.1. </span><span class="content">The <a class="property" data-link-type="propdesc" href="#propdef-shape-inside" id="ref-for-propdef-shape-inside-2">shape-inside</a> property</span><a class="self-link" href="#shape-inside-property"></a></h3>
<p>CSS Shapes <a data-link-type="biblio" href="#biblio-css-shapes-1">[CSS-SHAPES-1]</a> define the <a class="property" data-link-type="propdesc" href="#propdef-shape-inside" id="ref-for-propdef-shape-inside-3">shape-inside</a> property that aligns contents along the edge of a possibly non-rectangular wrapping area. Web authors may use this feature to fit contents inside a round display. However, it can be challenging to specify the wrapping area to be identical to the shape of a display. To address such cases, <a class="property" data-link-type="propdesc" href="#propdef-shape-inside" id="ref-for-propdef-shape-inside-4">shape-inside</a> is extended with a new value named '<code>display</code>', such an element having this value will have its content (or contained elements) aligned along the display border automatically.</p>
<table class="def propdef" data-link-for-hint="shape-inside">
<tbody>
<tr>
<th>Name:
<td><dfn class="dfn-paneled css" data-dfn-type="property" data-export="" id="propdef-shape-inside">shape-inside</dfn>
<tr class="value">
<th>Value:
<td class="prod">auto <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> outside-shape <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-shapes-1/#typedef-basic-shape"><basic-shape></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-any">||</a> shape-box ] <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-images-3/#typedef-image"><image></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> <code>display</code>
<tr>
<th>Initial:
<td>auto
<tr>
<th>Applies to:
<td>block-level elements
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>n/a
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>computed lengths for <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-shapes-1/#typedef-basic-shape"><basic-shape></a>, the absolute URI for <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css2/syndata.html#value-def-uri"><uri></a>, otherwise as specified
<tr>
<th>Animatable:
<td>as specified for <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-shapes-1/#typedef-basic-shape"><basic-shape></a>, otherwise no
</table>
<p>The example below shows how the <a class="property" data-link-type="propdesc" href="#propdef-shape-inside" id="ref-for-propdef-shape-inside-5">shape-inside</a> property works when it is set to '<code>display</code>'. Without using Media Queries, contents can be aligned within the display edge automatically.</p>
<div class="example" id="example-8ccfd74e">
<a class="self-link" href="#example-8ccfd74e"></a>
<pre class="lang-html highlight"><span></span><span class="p"><</span><span class="nt">style</span><span class="p">></span>
<span class="nn">#container</span> <span class="p">{</span>
<span class="n">shape</span><span class="o">-</span><span class="nb">inside</span><span class="o">:</span> <span class="nb">display</span><span class="p">;</span>
<span class="o">//</span> <span class="n">the</span> <span class="n">same</span> <span class="n">as</span> <span class="nb">circle</span><span class="p">(</span><span class="m">50%</span> <span class="n">at</span> <span class="m">50%</span><span class="o">,</span> <span class="m">50%</span><span class="p">)</span> <span class="n">in</span> <span class="n">a</span> <span class="n">regular</span> <span class="n">round</span> <span class="nb">display</span>
<span class="p">}</span>
<span class="nn">#green-box</span> <span class="p">{</span> <span class="nb">float</span><span class="o">:</span> <span class="nb">left</span><span class="p">;</span> <span class="p">}</span>
<span class="nn">#blue-box</span> <span class="p">{</span> <span class="nb">float</span><span class="o">:</span> <span class="nb">right</span><span class="p">;</span> <span class="p">}</span>
<span class="p"></</span><span class="nt">style</span><span class="p">></span>
<span class="p"><</span><span class="nt">div</span> <span class="na">id</span><span class="o">=</span><span class="s">"container"</span><span class="p">></span>
<span class="p"><</span><span class="nt">p</span><span class="p">></span>
Some inline content
<span class="p"><</span><span class="nt">img</span> <span class="na">id</span><span class="o">=</span><span class="s">"green-box"</span> <span class="na">src</span><span class="o">=</span><span class="s">"green-box.jpg"</span> <span class="p">/></span>
with a float left and float right, in a
<span class="p"><</span><span class="nt">img</span> <span class="na">id</span><span class="o">=</span><span class="s">"blue-box"</span> <span class="na">src</span><span class="o">=</span><span class="s">"blue-box.jpg"</span> <span class="p">/></span>
simple box with a circle shape-inside.
<span class="p"></</span><span class="nt">p</span><span class="p">></span>
<span class="p"></</span><span class="nt">div</span><span class="p">></span>
</pre>
<p><br></p>
<div class="figure">
<div style="height: 400px;">
<div style="float: left; width: 300px;">
<img alt="A layout of web contents without shape-inside:display" src="images/shape_inside_watch_a.png" style="width: 230px">
<p>(A) Without '<code>shape-inside</code>'</p>
</div>
<div style="float: right; width: 300px;">
<img alt="A layout of web contents with shape-inside: display" src="images/shape_inside_watch_b.png" style="width: 230px">
<p>(B) With '<code>shape-inside: display</code>'</p>
</div>
</div>
<figcaption> Align the content along the display border </figcaption>
</div>
</div>
<p>This property is specially useful for complex shapes (e.g. curved, stelliform, polygonal), that wouldn’t be covered by <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-shapes-1/#typedef-basic-shape"><basic-shape></a> (i.e. circle() or ellipse()), allowing web authors to conveniently align contents with the display edge.</p>
<p>When a containing block is placed on one end of the display and the containing block has 'shape-inside: display', the descendant blocks of the containing block are basically put on the overlapping region between the containing block and the display area. The overlapping region’s shape is mostly complicated shape, so it’s difficult to define the shape using previous method like basic-shape. The figure 4 describes these circumstances as follows.</p>
<div class="figure">
<img alt="An image of two examples to show the principle of shape-inside: display" src="images/shape_inside_a.png" style="width: 500px">
<figcaption> Align the content along the display border </figcaption>
</div>
<p class="issue" id="issue-8d78506c"><a class="self-link" href="#issue-8d78506c"></a> What if content overflows? Clipping or scrolling? </p>
<h2 class="heading settled" data-level="6" id="drawing-borders"><span class="secno">6. </span><span class="content">Drawing borders around the display border</span><a class="self-link" href="#drawing-borders"></a></h2>
<h3 class="heading settled" data-level="6.1" id="border-boundary-property"><span class="secno">6.1. </span><span class="content">The <a class="property" data-link-type="propdesc" href="#propdef-border-boundary" id="ref-for-propdef-border-boundary-2">border-boundary</a> property</span><a class="self-link" href="#border-boundary-property"></a></h3>
<p>We add the <a class="property" data-link-type="propdesc" href="#propdef-border-boundary" id="ref-for-propdef-border-boundary-3">border-boundary</a> property to set a boundary constraint that affects the borders of an element.</p>
<table class="def propdef" data-link-for-hint="border-boundary">
<tbody>
<tr>
<th>Name:
<td><dfn class="dfn-paneled css" data-dfn-type="property" data-export="" id="propdef-border-boundary">border-boundary</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> parent <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> display
<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>yes
<tr>
<th>Percentages:
<td>n/a
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>as specified
<tr>
<th>Animation type:
<td>discrete
</table>
<p>When the <a class="property" data-link-type="propdesc" href="#propdef-border-boundary" id="ref-for-propdef-border-boundary-4">border-boundary</a> property on an element is set to '<code>parent</code>', additional borders of the element could be drawn where the element’s area and the borders of its parent are met. When it is set to '<code>display</code>', additional borders could be drawn where the element’s area and the borders of screen are met. The default value is '<code>none</code>', imposing no boundary constraint on the borders.</p>
<div class="example" id="example-4dd1eedd">
<a class="self-link" href="#example-4dd1eedd"></a> The example below shows how the <a class="property" data-link-type="propdesc" href="#propdef-border-boundary" id="ref-for-propdef-border-boundary-5">border-boundary</a> property works on drawing borders. The result is shown in Figure 5B.
<pre class="lang-html highlight"><span></span><span class="p"><</span><span class="nt">style</span><span class="p">></span>
<span class="nn">#container</span> <span class="p">{</span>
<span class="nb">border</span><span class="o">-</span><span class="n">boundary</span><span class="o">:</span> <span class="nb">display</span><span class="p">;</span>
<span class="p">}</span>
<span class="nn">#redBox</span> <span class="p">{</span>
<span class="nb">border</span><span class="o">:</span> <span class="m">5px</span> <span class="nb">red</span> <span class="nb">solid</span><span class="p">;</span>
<span class="p">}</span>
<span class="nn">#greenBox</span> <span class="p">{</span>
<span class="nb">border</span><span class="o">:</span> <span class="m">5px</span> <span class="nb">green</span> <span class="nb">solid</span><span class="p">;</span>
<span class="p">}</span>
<span class="nn">#blueBox</span> <span class="p">{</span>
<span class="nb">border</span><span class="o">:</span> <span class="m">5px</span> <span class="nb">blue</span> <span class="nb">solid</span><span class="p">;</span>
<span class="p">}</span>
<span class="p"></</span><span class="nt">style</span><span class="p">></span>
<span class="p"><</span><span class="nt">div</span> <span class="na">id</span><span class="o">=</span><span class="s">"container"</span><span class="p">></span>
<span class="p"><</span><span class="nt">div</span> <span class="na">id</span><span class="o">=</span><span class="s">"redBox"</span><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">id</span><span class="o">=</span><span class="s">"greenBox"</span><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">id</span><span class="o">=</span><span class="s">"blueBox"</span><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>
<p><br></p>
<div class="figure">
<div style="height: 300px;">
<div style="float: left; width: 300px;">
<img alt="An image of circle drawing border lines without border-boundary: display" src="images/border_boundary_a.png" style="width: 200px">
<p>(A) Without '<code>border-boundary</code>'</p>
</div>
<div style="float: right; width: 300px;">
<img alt="An image of circle drawing border lines with border-boundary: display" src="images/border_boundary_b.png" style="width: 200px">
<p>(B) With '<code>border-boundary: display</code>'</p>
</div>
</div>
<figcaption> Align the content along the display border </figcaption>
</div>
</div>
<p class="note" role="note">Note: If the value of <a class="property" data-link-type="propdesc" href="#propdef-border-boundary" id="ref-for-propdef-border-boundary-6">border-boundary</a> is parent or display, border lines of the element are actually just a visual effect. It triggers a layout for rendering in a general way, but in the above cases (border-boundary: parent|display), the layout doesn’t occur and it only draws the border lines inward from the containing block’s borders. With this situation, the borders might hide contents around the display edge. </p>
<h2 class="heading settled" data-level="7" id="positioning-content"><span class="secno">7. </span><span class="content">Position the element along the path</span><a class="self-link" href="#positioning-content"></a></h2>
This section introduces specifying a path and positioning the element along it.
<p>A path can be defined with <a class="property" data-link-type="propdesc" href="#propdef-offset-path" id="ref-for-propdef-offset-path-1">offset-path</a> and <a class="property" data-link-type="propdesc" href="#propdef-offset-position" id="ref-for-propdef-offset-position-1">offset-position</a>. The position of the element on the path is computed by the value of <a class="property" data-link-type="propdesc" href="#propdef-offset-distance" id="ref-for-propdef-offset-distance-1">offset-distance</a> and <a class="property" data-link-type="propdesc" href="#propdef-offset-anchor" id="ref-for-propdef-offset-anchor-1">offset-anchor</a>.</p>
<h3 class="heading settled" data-level="7.1" id="offset-path-property"><span class="secno">7.1. </span><span class="content">Define the path: The <a class="property" data-link-type="propdesc" href="#propdef-offset-path" id="ref-for-propdef-offset-path-2">offset-path</a> property</span><a class="self-link" href="#offset-path-property"></a></h3>
<table class="def propdef" data-link-for-hint="offset-path">
<tbody>
<tr>
<th>Name:
<td><dfn class="dfn-paneled css" data-dfn-type="property" data-export="" id="propdef-offset-path">offset-path</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/#url-value"><url></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/#angle-value" title="Expands to: turn | rad | grad | deg"><angle></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-shapes-1/#typedef-basic-shape"><basic-shape></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> <a class="production css" data-link-type="function" href="#funcdef-offset-path-path" id="ref-for-funcdef-offset-path-path-1"><path()></a> ] <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-any">||</a> <a class="production css" data-link-type="type" href="https://drafts.fxtf.org/css-masking-1/#typedef-geometry-box"><geometry-box></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> none
<tr>
<th>Initial:
<td>0deg for <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#angle-value" title="Expands to: turn | rad | grad | deg"><angle></a>, otherwise no
<tr>
<th>Applies to:
<td>All elements. In SVG, it applies to <a data-link-type="dfn" href="https://svgwg.org/svg2-draft/struct.html#container-element">container elements</a> excluding the <code><a data-link-type="element" href="https://www.w3.org/TR/SVG11/struct.html#DefsElement">defs</a></code> element and all <a data-link-type="dfn" href="https://svgwg.org/svg2-draft/struct.html#graphics-element">graphics elements</a>
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>as specified
<tr>
<th>Animatable:
62C3
div>
<td>as specified for <a href="https://www.w3.org/TR/css3-transitions/#animatable-types">angle</a>, otherwise no
</table>
<p>Specifies the <a data-link-type="dfn" href="#path" id="ref-for-path-1">path</a> the element gets positioned at. The exact element’s position on the path is determined by the <a class="property" data-link-type="propdesc" href="#propdef-offset-distance" id="ref-for-propdef-offset-distance-2">offset-distance</a> property. A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="path">path</dfn> is either a specified path with one or multiple sub-paths or the geometry of a not styled basic shape. Each shape or path must define an <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="initial-position">initial position</dfn> for the computed value of "0" for <a class="property" data-link-type="propdesc" href="#propdef-offset-distance" id="ref-for-propdef-offset-distance-3">offset-distance</a> or the position specified by <a class="property" data-link-type="propdesc" href="#propdef-offset-position" id="ref-for-propdef-offset-position-2">offset-position</a>. An <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="initial-direction">initial direction</dfn> which specifies the rotation of the object on the initial position.</p>
<p>Values have the following meanings:</p>
<dl>
<dt><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#angle-value" title="Expands to: turn | rad | grad | deg"><angle></a>
<dd>
The path is a straight line that has the degree of the angle as specified in <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#angle-value" title="Expands to: turn | rad | grad | deg"><angle></a> from the Y-axis. The initial position of the path is the center of the containing block and the end point of the path is on the edge of the containing block.
<p class="note" role="note">Note: Defining the path with <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#angle-value" title="Expands to: turn | rad | grad | deg"><angle></a>, the element can be positioned in the polar coordinate system. In polar coordinates, a pole is the reference point and points are described as been a certain distance from it, as also a certain angle from the polar axis. In mathematical theory, the polar axis is commonly defined as the positive direction of the x-axis, but we consider the polar axis as the positive direction of the y-axis position as other CSS specifications usually do. Therefore, when the <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#angle-value" title="Expands to: turn | rad | grad | deg"><angle></a> value of <a class="property" data-link-type="propdesc" href="#propdef-offset-path" id="ref-for-propdef-offset-path-3">offset-path</a> is 0, the element is positioned on the y-axis. If the <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#angle-value" title="Expands to: turn | rad | grad | deg"><angle></a> value increases in the positive direction from 0, the element moves clockwise. The method to determine a direction using the <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#angle-value" title="Expands to: turn | rad | grad | deg"><angle></a> value for <a class="property" data-link-type="propdesc" href="#propdef-offset-path" id="ref-for-propdef-offset-path-4">offset-path</a> works the same way in <a data-link-type="biblio" href="#biblio-css3val">[CSS3VAL]</a>, <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#angle-value" title="Expands to: turn | rad | grad | deg"><angle></a> value.</p>
<dt><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-shapes-1/#typedef-basic-shape"><basic-shape></a>
<dd>
The path is a basic shape as specified in CSS Shapes <a data-link-type="biblio" href="#biblio-css-shapes-1">[CSS-SHAPES-1]</a>. The initial position and the initial direction for basic shapes are defined as follows:
<dl>
<dt><a class="production css" data-link-type="function" href="https://drafts.csswg.org/css-shapes-1/#funcdef-circle"><circle()></a>
<dt><a class="production css" data-link-type="function" href="https://drafts.csswg.org/css-shapes-1/#funcdef-ellipse"><ellipse()></a>
<dd>The <a data-link-type="dfn" href="#initial-position" id="ref-for-initial-position-1">initial position</a> is defined by the point where a virtual tangent to the circle/ellipse would reach the top vertical position. The <a data-link-type="dfn" href="#initial-direction" id="ref-for-initial-direction-1">initial direction</a> is 90 degrees.
<dt><a class="production css" data-link-type="function" href="https://drafts.csswg.org/css-shapes-1/#funcdef-inset"><inset()></a>
<dd>The <a data-link-type="dfn" href="#initial-position" id="ref-for-initial-position-2">initial position</a> is defined by the left top corner of the rectangle. The <a data-link-type="dfn" href="#initial-direction" id="ref-for-initial-direction-2">initial direction</a> is 0 degree.
<dt><a class="production css" data-link-type="function" href="https://drafts.csswg.org/css-shapes-1/#funcdef-polygon"><polygon()></a>
<dd>The <a data-link-type="dfn" href="#initial-position" id="ref-for-initial-position-3">initial position</a> is defined by the first coordinate pair of the polygon. The <a data-link-type="dfn" href="#initial-direction" id="ref-for-initial-direction-3">initial direction</a> is defined by the vector connecting the initial position with the next following coordinate pair that isn’t equal to the initial position. If there is no such unequal coordinate pair, the initial direction is defined with 0 degree.
</dl>
<dt><dfn class="dfn-paneled css" data-dfn-for="offset-path" data-dfn-type="function" data-export="" id="funcdef-offset-path-path">path()</dfn> = path([ <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-shapes-2/#typedef-fill-rule"><fill-rule></a> ,]? <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#string-value"><string></a>)
<dd>
<p>The <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#string-value"><string></a> represents an SVG Path data string. The path data string must be conform to the grammar and parsing rules of SVG 1.1 <a data-link-type="biblio" href="#biblio-svg11">[SVG11]</a>. The initial position is defined by the first “move to” argument in the path string. For the initial direction follow SVG 1.1 <a data-link-type="biblio" href="#biblio-svg11">[SVG11]</a>. </p>
<p><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-shapes-2/#typedef-fill-rule"><fill-rule></a> - The filling rule used to determine the interior of the path. See <a class="property" data-link-type="propdesc" href="https://svgwg.org/svg2-draft/painting.html#FillRuleProperty">fill-rule</a> property in SVG for details. Possible values are <a class="css" data-link-type="maybe" href="https://drafts.fxtf.org/css-masking-1/#valdef-clip-rule-nonzero">nonzero</a> or <a class="css" data-link-type="maybe" href="https://drafts.fxtf.org/css-masking-1/#valdef-clip-rule-evenodd">evenodd</a>. Default value when omitted is <a class="css" data-link-type="maybe" href="https://drafts.fxtf.org/css-masking-1/#valdef-clip-rule-nonzero">nonzero</a>. </p>
<dt><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#url-value"><url></a>
<dd> References an SVG <a data-link-type="dfn" href="https://svgwg.org/svg2-draft/shapes.html#TermShapeElement">shape element</a> and uses its geometry as motion path. See SVG 1.1 for more information about the initial position and initial direction <a data-link-type="biblio" href="#biblio-svg11">[SVG11]</a>.
<dt><dfn class="dfn-paneled css" data-dfn-for="offset-path" data-dfn-type="value" data-export="" id="valdef-offset-path-none">none</dfn>
<dd>No path gets created.
</dl>
<p>A computed value of other than <a class="css" data-link-type="maybe" href="#valdef-offset-path-none" id="ref-for-valdef-offset-path-none-1">none</a> results in the creation of a <a data-link-type="dfn" href="https://drafts.csswg.org/css2/visuren.html#x44">stacking context</a> <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a> the same way that CSS <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-color-4/#propdef-opacity">opacity</a> <a data-link-type="biblio" href="#biblio-css3color">[CSS3COLOR]</a> does for values other than <span class="css">1</span>, unless the element is an SVG element with out an associated CSS layout box.</p>
<p>A reference that fails to download, is not a reference to an SVG <a data-link-type="dfn" href="https://svgwg.org/svg2-draft/shapes.html#TermShapeElement">shape element</a> element, or is non-existent is ignored. No motion path and no stacking context are created.</p>
<p>For SVG elements without associated CSS layout box, the <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-4/#used-value">used value</a> for <a class="css" data-link-type="value" href="https://drafts.fxtf.org/css-masking-1/#valdef-mask-clip-content-box">content-box</a>, <a class="css" data-link-type="value" href="https://drafts.fxtf.org/css-masking-1/#valdef-mask-clip-padding-box">padding-box</a>, <a class="css" data-link-type="value" href="https://drafts.fxtf.org/css-masking-1/#valdef-mask-clip-border-box">border-box</a> and <a class="css" data-link-type="value" href="https://drafts.fxtf.org/css-masking-1/#valdef-mask-clip-margin-box">margin-box</a> is <a class="css" data-link-type="value" href="https://drafts.fxtf.org/css-masking-1/#valdef-clip-path-fill-box">fill-box</a>.</p>
<p>For elements with associated CSS layout box, the <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-4/#used-value">used value</a> for <a class="css" data-link-type="value" href="https://drafts.fxtf.org/css-masking-1/#valdef-clip-path-fill-box">fill-box</a>, <a class="css" data-link-type="value" href="https://drafts.fxtf.org/css-masking-1/#valdef-clip-path-stroke-box">stroke-box</a> and <a class="css" data-link-type="value" href="https://drafts.fxtf.org/css-masking-1/#valdef-clip-path-view-box">view-box</a> is <a class="css" data-link-type="value" href="https://drafts.fxtf.org/css-masking-1/#valdef-mask-clip-border-box">border-box</a>.</p>
<h3 class="heading settled" data-level="7.2" id="offset-position-property"><span class="secno">7.2. </span><span class="content">Define the initial position of the path: The <a class="property" data-link-type="propdesc" href="#propdef-offset-position" id="ref-for-propdef-offset-position-3">offset-position</a> property</span><a class="self-link" href="#offset-position-property"></a></h3>
<table class="def propdef" data-link-for-hint="offset-position">
<tbody>
<tr>
<th>Name:
<td><dfn class="dfn-paneled css" data-dfn-type="property" data-export="" id="propdef-offset-position">offset-position</dfn>
<tr class="value">
<th>Value:
<td class="prod">auto <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-backgrounds-3/#position"><position></a>
<tr>
<th>Initial:
<td>auto
<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>Refer to the size of containing block
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>as specified
<tr>
<th>Animatable:
<td>as <a href="https://www.w3.org/TR/css3-transitions/#animtype-lpcalc">position</a>
</table>
<p>Specifies the initial position of the path.</p>
<p>Values are defined as follows:</p>
<dl>
<dt><var><a class="property" data-link-type="propdesc">auto</a></var>
<dd>
Computes differently according to the type of value of <a class="property" data-link-type="propdesc" href="#propdef-offset-path" id="ref-for-propdef-offset-path-5">offset-path</a>:
<dl>
<dt><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#angle-value" title="Expands to: turn | rad | grad | deg"><angle></a>
<dd>The center of the containing block
<dt><a class="production css" data-link-type="function" href="https://drafts.csswg.org/css-shapes-1/#funcdef-circle"><circle()></a>, <a class="production css" data-link-type="function" href="https://drafts.csswg.org/css-shapes-1/#funcdef-ellipse"><ellipse()></a>
<dd>The point where a virtual tangent to the circle/ellipse would reach the top vertical position
<dt><a class="production css" data-link-type="function" href="https://drafts.csswg.org/css-shapes-1/#funcdef-inset"><inset()></a>
<dd>The left top corner of the rectangle
<dt><a class="production css" data-link-type="function" href="https://drafts.csswg.org/css-shapes-1/#funcdef-polygon"><polygon()></a>
<dd>The first coordinate pair of the polygon
<dt><a class="production css" data-link-type="function" href="#funcdef-offset-path-path" id="ref-for-funcdef-offset-path-path-2"><path()></a>
<dd>The first "move to" argument in the path string
</dl>
<dt><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-backgrounds-3/#position"><position></a>
<dd>
Values of <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-backgrounds-3/#position"><position></a> are defined like below:
<dl>
<dt><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#percentage-value"><percentage></a>
<dd> A percentage for the horizontal offset is relative to the width of the containing block. A percentage for the vertical offset is relative to height of the containing block.
<dt><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>
<dd> A length value gives a fixed length as the offset. The value for the horizontal and vertical offset represent an offset from the top left corner of the containing block.
<dt><dfn data-dfn-for="offset-position" data-dfn-type="dfn" data-noexport="" id="offset-position-top">top<a class="self-link" href="#offset-position-top"></a></dfn>
<dd> Computes to 0% for the vertical position.
<dt><dfn data-dfn-for="offset-position" data-dfn-type="dfn" data-noexport="" id="offset-position-right">right<a class="self-link" href="#offset-position-right"></a></dfn>
<dd> Computes to 100% for the horizontal position.
<dt><dfn data-dfn-for="offset-position" data-dfn-type="dfn" data-noexport="" id="offset-position-bottom">bottom<a class="self-link" href="#offset-position-bottom"></a></dfn>
<dd> Computes to 100% for the vertical position.
<dt><dfn data-dfn-for="offset-position" data-dfn-type="dfn" data-noexport="" id="offset-position-left">left<a class="self-link" href="#offset-position-left"></a></dfn>
<dd> Computes to 0% for the horizontal position.
<dt><dfn data-dfn-for="offset-position" data-dfn-type="dfn" data-noexport="" id="offset-position-center">center<a class="self-link" href="#offset-position-center"></a></dfn>
<dd> Computes to 50% (left 50%) for the horizontal position if the horizontal position is not otherwise specified, or 50% (top 50%) for the vertical position if it is.
</dl>
</dl>
<h3 class="heading settled" data-level="7.3" id="offset-distance-property"><span class="secno">7.3. </span><span class="content">Position on the path: The <a class="property" data-link-type="propdesc" href="#propdef-offset-distance" id="ref-for-propdef-offset-distance-4">offset-distance</a> property</span><a class="self-link" href="#offset-distance-property"></a></h3>
<table class="def propdef" data-link-for-hint="offset-distance">
<tbody>
<tr>
<th>Name:
<td><dfn class="dfn-paneled css" data-dfn-type="property" data-export="" id="propdef-offset-distance">offset-distance</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 class="production css" data-link-type="type" href="https://drafts.csswg.org/css-images-3/#typedef-size" title="Expands to: farthest-side | closest-corner | [ <length> | <percentage> ]{2} | <length> | closest-side | farthest-corner"><size></a><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/#comb-all">&&</a> contain<a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#mult-opt">?</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>Refer to the total length of the path
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>as specified
<tr>
<th>Animatable:
<td>yes
</table>
<p>A distance that describes the position along the specified path.</p>
<p>Values are defined as follows:</p>
<dl>
<dt><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>
<dd> The distance from the initial position of the shape or path to the position of the element. Percentages are relative to the total path length including all sub-paths.
<dt><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#percentage-value"><percentage></a>
<dd> Is relative to the length of the path. The length is a distance between the initial position and the end position which is the contact point of the edge of the containing block and the path.
<dt><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-images-3/#typedef-size" title="Expands to: farthest-side | closest-corner | [ <length> | <percentage> ]{2} | <length> | closest-side | farthest-corner"><size></a>
<dd>
Decides a point used for measuring the distance from the initial position of the path.
<p>It is defined as</p>
<p> <b><size></b> = [ closest-side | closest-corner | farthest-side | farthest-corner ]</p>
<p>If omitted it defaults to <var>closest-side</var>.</p>
<dl>
<dt><dfn data-dfn-type="dfn" data-noexport="" id="closet-side">closet-side<a class="self-link" href="#closet-side"></a></dfn>
<dd>The distance is measured between the initial position and the closest side of the box from it.
<dt><dfn data-dfn-type="dfn" data-noexport="" id="closest-corner">closest-corner<a class="self-link" href="#closest-corner"></a></dfn>
<dd>The distance is measured between the initial position and the closest corner of the box from it.
<dt><dfn data-dfn-type="dfn" data-noexport="" id="farthest-side">farthest-side<a class="self-link" href="#farthest-side"></a></dfn>
<dd>The distance is measured between the initial position and the farthest side of the box from it.
<dt><dfn data-dfn-type="dfn" data-noexport="" id="farthest-corner">farthest-corner<a class="self-link" href="#farthest-corner"></a></dfn>
<dd>The distance is measured between the initial position and the farthest corner of the box from it.
</dl>
<p class="note" role="note">Note: When the initial position is at one of the corners of the containing block, the closest side takes the edge where the initial position is on. Even if the offset given by <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> or <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#percentage-value"><percentage></a> changes, the position of the element specified with closest-side is the same.</p>
<dt><dfn data-dfn-type="dfn" data-noexport="" id="contain">contain<a class="self-link" href="#contain"></a></dfn>
<dd> Adjust the value of <a class="property" data-link-type="propdesc" href="#propdef-offset-distance" id="ref-for-propdef-offset-distance-5">offset-distance</a> when the element goes out of the path. When overflowing occurs, the distance value is reduced, until there is a contact point between the path and content block of the element.
</dl>
<p>See the section Motion processing for how to process a motion position.</p>
<div class="example" id="example-6c7f2fc4">
<a class="self-link" href="#example-6c7f2fc4"></a> This example shows a way to align elements within the polar coordinate system using <a class="property" data-link-type="propdesc" href="#propdef-offset-path" id="ref-for-propdef-offset-path-6">offset-path</a>, <a class="property" data-link-type="propdesc" href="#propdef-offset-distance" id="ref-for-propdef-offset-distance-6">offset-distance</a> and <a class="property" data-link-type="propdesc" href="#propdef-offset-position" id="ref-for-propdef-offset-position-4">offset-position</a>.
<pre class="lang-html highlight"><span></span><span class="p"><</span><span class="nt">body</span><span class="p">></span>
<span class="p"><</span><span class="nt">div</span> <span class="na">id</span><span class="o">=</span><span class="s">"circle1"</span><span class="err"></</span><span class="na">div</span><span class="p">></span>
<span class="p"><</span><span class="nt">div</span> <span class="na">id</span><span class="o">=</span><span class="s">"circle2"</span><span class="err"></</span><span class="na">div</span><span class="p">></span>
<span class="p"><</span><span class="nt">div</span> <span class="na">id</span><span class="o">=</span><span class="s">"circle3"</span><span class="err"></</span><span class="na">div</span><span class="p">></span>
<span class="p"></</span><span class="nt">body</span><span class="p">></span>
<span class="p"><</span><span class="nt">style</span><span class="p">></span>
<span class="nn">#circle1</span> <span class="p">{</span>
<span class="n">offset</span><span class="o">-</span><span class="n">path</span><span class="o">:</span> <span class="m">0</span><span class="n">deg</span><span class="p">;</span>
<span class="n">offset</span><span class="o">-</span><span class="n">distance</span><span class="o">:</span> <span class="m">50%</span><span class="p">;</span>
<span class="p">}</span>
<span class="nn">#circle2</span> <span class="p">{</span>
<span class="n">offset</span><span class="o">-</span><span class="n">path</span><span class="o">:</span> <span class="m">90</span><span class="n">deg</span><span class="p">;</span>
<span class="n">offset</span><span class="o">-</span><span class="n">distance</span><span class="o">:</span> <span class="m">20%</span><span class="p">;</span>
<span class="p">}</span>
<span class="nn">#circle3</span> <span class="p">{</span>
<span class="n">offset</span><span class="o">-</span><span class="n">path</span><span class="o">:</span> <span class="m">225</span><span class="n">deg</span><span class="p">;</span>
<span class="n">offset</span><span class="o">-</span><span class="n">distance</span><span class="o">:</span> <span class="m">100%</span><span class="p">;</span>
<span class="p">}</span>
<span class="p"></</span><span class="nt">style</span><span class="p">></span>
</pre>
<div class="figure">
<img alt="An image of three elements positioned to polar coordinates" src="images/simple_offset_position.png" style="width: 300px;">
<figcaption> An example of positioning element in polar coordinates </figcaption>
</div>
</div>
<div class="example" id="example-281c33a3">
<a class="self-link" href="#example-281c33a3"></a> Here are some examples. The first example shows some parts of elements are outside of the path.
<pre class="lang-html highlight"><span></span><span class="p"><</span><span class="nt">body</span><span class="p">></span>
<span class="p"><</span><span class="nt">div</span> <span class="na">style</span><span class="o">=</span><span class="s">"offset-path: 45deg; offset-distance: 100%"</span><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">style</span><span class="o">=</span><span class="s">"offset-path: 180deg; offset-distance: 100%"</span><span class="p">></</span><span class="nt">div</span><span class="p">></span>
<span class="p"></</span><span class="nt">body</span><span class="p">></span>
</pre>
<div class="figure">
<img alt="An image of elements positioned without contain" src="images/offset_distance_without_contain.png" style="width: 300px;">
<figcaption> <a class="property" data-link-type="propdesc" href="#propdef-offset-distance" id="ref-for-propdef-offset-distance-7">offset-distance</a> without <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-containment-3/#propdef-contain">contain</a> </figcaption>
</div>
<p>In the second example, contain, the extent keyword value is added to the <a class="property" data-link-type="propdesc" href="#propdef-offset-distance" id="ref-for-propdef-offset-distance-8">offset-distance</a> value of each element to avoid overflowing.</p>
<pre class="lang-html highlight"><span></span><span class="p"><</span><span class="nt">body</span><span class="p">></span>
<span class="p"><</span><span class="nt">div</span> <span class="na">style</span><span class="o">=</span><span class="s">"offset-path: 45deg; offset-distance: 100% contain"</span><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">style</span><span class="o">=</span><span class="s">"offset-path: 180deg; offset-distance: 100% contain"</span><span class="p">></</span><span class="nt">div</span><span class="p">></span>
<span class="p"></</span><span class="nt">body</span><span class="p">></span>
</pre>
<div class="figure">
<img alt="An image of elements positioned without contain" src="images/offset_distance_with_contain.png" style="width: 300px;">
<figcaption> <a class="property" data-link-type="propdesc" href="#propdef-offset-distance" id="ref-for-propdef-offset-distance-9">offset-distance</a> with <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-containment-3/#propdef-contain">contain</a> </figcaption>
</div>
</div>
<h3 class="heading settled" data-level="7.4" id="offset-anchor-property"><span class="secno">7.4. </span><span class="content">The anchor of the element: The <a class="property" data-link-type="propdesc" href="#propdef-offset-anchor" id="ref-for-propdef-offset-anchor-2">offset-anchor</a> property</span><a class="self-link" href="#offset-anchor-property"></a></h3>
<table class="def propdef" data-link-for-hint="offset-anchor">
<tbody>
<tr>
<th>Name:
<td><dfn class="dfn-paneled css" data-dfn-type="property" data-export="" id="propdef-offset-anchor">offset-anchor</dfn>
<tr class="value">
<th>Value:
<td class="prod"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-backgrounds-3/#position"><position></a>
<tr>
<th>Initial:
<td><a class="property" data-link-type="propdesc">auto</a>
<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 width and height of an element
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>as specified
<tr>
<th>Animatable:
<td>as <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-backgrounds-3/#position"><position></a>
</table>