-
Notifications
You must be signed in to change notification settings - Fork 791
Expand file tree
/
Copy pathOverview.html
More file actions
1167 lines (870 loc) · 41.3 KB
/
Overview.html
File metadata and controls
1167 lines (870 loc) · 41.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang=en>
<head>
<title>CSS Backgrounds and Borders Module Level 4</title>
<link href="../default.css" rel=stylesheet type="text/css">
<style type="text/css">
.prod { font-family: inherit; font-size: inherit }
pre.prod { white-space: pre-wrap; margin: 1em 0 1em 2em }
code { font-size: inherit; }
#box-shadow-samples td { background: white; color: black; }
</style>
<link href="http://www.w3.org/StyleSheets/TR/W3C-ED.css" rel=stylesheet
type="text/css">
<body>
<div class=head> <!--begin-logo-->
<p><a href="http://www.w3.org/"><img alt=W3C height=48
src="http://www.w3.org/Icons/w3c_home" width=72></a> <!--end-logo-->
<h1>CSS Backgrounds and Borders Module Level 4</h1>
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 1 April 2010</h2>
<dl>
<dt>This version:
<dd><!--<a href="http://www.w3.org/TR/2010/CR-css3-background-20100401">http://www.w3.org/TR/2010/ED-css3-background-20100401</a>-->
<a
href="http://dev.w3.org/csswg/css4-background">http://dev.w3.org/csswg/css3-background</a>
<dt>Latest version:
<dd><a
href="http://www.w3.org/TR/css4-background">http://www.w3.org/TR/css3-background</a>
<dt>Previous versions:
<dd>None
<dt id=editors-list>Editors:
<dd><a href="http://fantasai.inkedblade.net/contact">Elika J. Etemad</a>
(Invited Expert)
<dd><a href="mailto:howcome@opera.com ">Håkon Wium Lie</a> (Opera
Software)
</dl>
<!--begin-copyright-->
<p class=copyright><a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
rel=license>Copyright</a> © 2010 <a
href="http://www.w3.org/"><acronym title="World Wide Web
Consortium">W3C</acronym></a><sup>®</sup> (<a
href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute
of Technology">MIT</acronym></a>, <a href="http://www.ercim.eu/"><acronym
title="European Research Consortium for Informatics and
Mathematics">ERCIM</acronym></a>, <a
href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. 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>
<!--end-copyright-->
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc" id=abstract>Abstract</h2>
<p>CSS is a language for describing the rendering of structured <a
href="#document">documents</a> (such as HTML and XML) on screen, on paper,
in speech, etc. This draft contains the features of CSS level 4
relating to borders and backgrounds. It includes and extends the
functionality of CSS level 3 [[!CSS3BACKGROUND]], which builds on CSS
level 2 <a href="#CSS21" rel=biblioentry>[CSS21]<!--{{CSS21}}--></a>.
The main extensions compared to level 3 are <span class=issue>Fill
this in later</span>
<h2 class="no-num no-toc" id=status>Status of this document</h2>
<!--begin-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>The (<a
href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public
mailing list <a
href="mailto:www-style@w3.org?Subject=%5Bcss3-background%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
“css3-background” in the subject, preferably like this:
“[<!---->css3-background<!---->] <em>…summary of
comment…</em>”
<p>This document was produced by the <a href="/Style/CSS/members">CSS
Working Group</a> (part of the <a href="/Style/">Style Activity</a>).
<p>This document was produced by a group operating under the <a
href="/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent
Policy</a>. W3C maintains a <a href="/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="/Consortium/Patent-Policy-20040205/#def-essential">Essential
Claim(s)</a> must disclose the information in accordance with <a
href="/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the
W3C Patent Policy</a>.</p>
<!--end-status-->
<p>The CSS WG maintains an <a
href="http://www.w3.org/Style/CSS/Tracker/products/11">issues list</a> for
this module. A <a href="http://www.w3.org/Style/CSS/Test/">test suite</a>
for CSS Backgrounds and Borders Level 3 will be developed during the
Candidate Recommendation phase.
<h2 class="no-num no-toc" id=contents>Table of contents</h2>
<!--begin-toc-->
<ul class=toc>
<li><a href="#introduction"><span class=secno>1. </span>Introduction</a>
<li><a href="#values"><span class=secno>2. </span>Values</a>
<li><a href="#backgrounds"><span class=secno>3. </span>Background
properties</a>
<li><a href="#borders"><span class=secno>4. </span>Border properties</a>
<li><a href="#clipping-borders"><span class=secno>5. </span>Clipping
borders</a>
<ul class=toc>
<li><a href="#the-border-clip-properties"><span class=secno>5.1.
</span>The ‘<code class=property>border-clip</code>’
properties</a>
</ul>
<li><a href="#definitions"><span class=secno>6. </span>Definitions</a>
<ul class=toc>
<li><a href="#glossary"><span class=secno>6.1. </span>Glossary</a>
<li><a href="#conformance"><span class=secno>6.2. </span>Conformance</a>
<li><a href="#levels"><span class=secno>6.3. </span>Levels</a>
<ul class=toc>
<li><a href="#level-1"><span class=secno>6.3.1. </span>CSS Level 1</a>
<li><a href="#level-2"><span class=secno>6.3.2. </span>CSS Level 2</a>
<li><a href="#level-3"><span class=secno>6.3.3. </span>CSS Level 3</a>
</ul>
<li><a href="#exit"><span class=secno>6.4. </span>CR exit criteria</a>
</ul>
<li><a href="#acknowledgments"><span class=secno>7.
</span>Acknowledgments</a>
<li><a href="#references"><span class=secno>8. </span>References</a>
<ul class=toc>
<li class=no-num><a href="#normative-references">Normative
references</a>
<li class=no-num><a href="#other-references">Other references</a>
</ul>
<li class=no-num><a href="#property-index">Property index</a>
<li class=no-num><a href="#index">Index</a>
</ul>
<!--end-toc-->
<h2 id=introduction><span class=secno>1. </span>Introduction</h2>
<p><em>This section is not normative.</em>
<p>When elements are rendered according to the <a
href="http://www.w3.org/TR/CSS21/box.html">CSS box model</a> <a
href="#CSS21" rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>, each element
is either not displayed at all, or formatted as one or more rectangular
boxes. Each box has a rectangular content area, a band of padding around
the content, a border around the padding, and a margin outside the border.
(The margin may actually be negative, but margins have no influence on the
background and border.)
<div class=figure>
<p><img alt="Diagram of a typical box, showing the content, padding,
border and margin areas" src=box>
<p class=caption>The various areas and edges of a typical box. (This
diagram is explained in the CSS2.1 Box Model chapter <a href="#CSS21"
rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>.)
</div>
<p>The properties of this module deal with the decoration of the border
area and with the background of the content, padding and border areas.
<p>The relative stacking order of backgrounds, borders, and shadows is
given in this module. For how these layers interact with other rendered
content, see Appendix E “Elaborate description of Stacking Contexts”
in <a href="#CSS21" rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>.
<h2 id=values><span class=secno>2. </span>Values</h2>
<p>This specification follows the <a
href="http://www.w3.org/TR/CSS21/about.html#property-defs">CSS property
definition conventions</a> from <a href="#CSS21"
rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>.
<p>Value types are defined in CSS Values Level 3 [[!CSS3VALUES]].
<p>All properties defined in this specification also accept the <a
href="http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit">inherit</a>
keyword as their value, but for readability it has not been listed
explicitly.
<h2 id=backgrounds><span class=secno>3. </span>Background properties</h2>
<p>Each box has a background layer that may be fully transparent (the
default), or filled with a color and/or one or more images. The background
properties specify the color and images (‘<code
class=property>background-image</code>’) to use, and how they are
sized, positioned, tiled, etc.
<p>The definitions of these properties are given in [[!CSS3BACKGROUNDS]].
<h2 id=borders><span class=secno>4. </span>Border properties</h2>
<p>The border can either be a predefined style (solid line, double line,
dotted line, pseudo-3D border, etc.) or it can be an image. In the former
case, various properties define the style, color, and thickness of the
border.
<p>The definitions of most of these properties are given in
[[!CSS3BACKGROUNDS]]. Additional properties are defined below.
<h2 id=clipping-borders><span class=secno>5. </span>Clipping borders</h2>
<p>CSS borders traditionally cover an entire border edge. Sometimes,
however, it can be useful to hide some parts of the border.
<h3 id=the-border-clip-properties><span class=secno>5.1. </span>The
‘<code class=property><a
href="#border-clip">border-clip</a></code>’ properties</h3>
<table class=propdef>
<tbody>
<tr>
<td><em>Name:</em>
<td><dfn id=border-clip>border-clip</dfn>, <dfn
id=border-clip-top>border-clip-top</dfn>, <dfn
id=border-clip-right>border-clip-right</dfn>, <dfn
id=border-clip-bottom>border-clip-bottom</dfn>, <dfn
id=border-clip-left>border-clip-left</dfn>
<tr>
<td><em>Value:</em>
<td>normal | [ <length> | <percentage> | <fraction> ]+
<tr>
<td><em>Initial:</em>
<td>normal
<tr>
<td><em>Applies to:</em>
<td>all elements
<tr>
<td><em>Inherited:</em>
<td>no
<tr>
<td><em>Percentages:</em>
<td>refer to width or height of element
<tr>
<td><em>Media:</em>
<td>visual
<tr>
<td><em>Computed value:</em>
<td>‘<code class=css>normal</code>’, or a list consisting of
absolute lengths, or percentages as specified
</table>
<p class=issue>Should these properties be simplified to only accept
<code>normal | [ <length> | <percentage> ] +</code>?
<p>These properties split their respective borders into parts along the
border edge. The first part is visible, the second is invisible, the third
part is visible, etc. Parts can be specified with lengths, percentages, or
fractions (expressed by the ‘<code class=property>fr</code>’
unit, as per <a href="#CSS3GRID"
rel=biblioentry>[CSS3GRID]<!--{{CSS3GRID}}--></a> or its <a
href="http://dev.w3.org/csswg/css3-grid/">editor's edition</a>). The
‘<code class=property>normal</code>’ value means that the
border is not split, but shown normally.
<p>‘<code class=property><a
href="#border-clip">border-clip</a></code>’ is a shorthand property
for the four individual properties.
<p>If the listed parts are shorter than the border, any remaining border is
split proportionally between the specified fractions. If there are no
fractions, the behavior is as if ‘<code class=css>1fr</code>’
had been specified at the end of the list.
<p>If the listed parts are longer than the border, the specified parts will
be shown in full until the end of the border. In this case, all fractions
will be zero.
<p>For horizontal borders, parts are listed from left to right. For
vertical borders, parts are listed from top to bottom.
<p>The exact border parts are determined by laying out the specified border
parts with all fractions initially set to zero. Any remaining border is
split proportionally between the fractions specified.
<div class=example>
<pre>
border-clip: 10px 1fr 10px;
</pre>
<div style="position: relative; width: 250px; height: 150px; background:
white;">
<div style="border: 2px solid black; width: 200px; height: 100px;
position: absolute; top: 20px; left: 20px">
<div style="position: absolute; background: white; left: 15px; top:
-5px; height: 110px; width: 170px"></div>
<div style="position: absolute; background: white; left: -5px; top:
15px; height: 70px; width: 210px"></div>
</div>
</div>
</div>
<div class=example>
<pre>
border-clip-top: 10px 1fr 10px;
border-clip-bottom: 10px 1fr 10px;
border-clip-right: 5px 1fr 5px;
border-clip-left: 5px 1fr 5px;
</pre>
<div style="position: relative; width: 250px; height: 150px; background:
white;">
<div style="border: 2px solid black; width: 200px; height: 100px;
position: absolute; top: 20px; left: 20px">
<div style="position: absolute; background: white; left: 15px; top:
-5px; height: 110px; width: 170px"></div>
<div style="position: absolute; background: white; left: -5px; top: 5px;
height: 90px; width: 210px"></div>
</div>
</div>
</div>
<div class=example>
<p>By making the first part have zero length, the inverse border of the
previous example can easily be created:
<pre>
border-clip-top: 0 10px 1fr 10px;
border-clip-bottom: 0 10px 1fr 10px;
border-clip-right: 0 5px 1fr 5px;
border-clip-left: 0 5px 1fr 5px;
</pre>
<div style="position: relative; width: 250px; height: 150px; background:
white;">
<div style="border: 2px solid black; width: 200px; height: 100px;
position: absolute; top: 20px; left: 20px">
<div style="position: absolute; background: white; left: -5px; top:
-5px; height: 10px; width: 15px"></div>
<div style="position: absolute; background: white; right: -5px; top:
-5px; height: 10px; width: 15px"></div>
<div style="position: absolute; background: white; left: -5px; top:
95px; height: 10px; width: 15px"></div>
<div style="position: absolute; background: white; right: -5px; top:
95px; height: 10px; width: 15px"></div>
</div>
</div>
</div>
<div class=example>
<pre>
border: thin solid black;
border-clip: 0 1fr; /* hide borders */
border-clip-top: 10px 1fr 10px; /* make certain borders visible */
border-clip-bottom: 10px 1fr 10px;
</pre>
<div style="position: relative; width: 250px; height: 150px; background:
white;">
<div style="border: 2px solid black; width: 200px; height: 100px;
position: absolute; top: 20px; left: 20px">
<div style="position: absolute; background: white; left: 15px; top:
-5px; height: 110px; width: 170px"></div>
<div style="position: absolute; background: white; left: -5px; top: 0px;
height: 100px; width: 210px"></div>
</div>
</div>
</div>
<div class=example>
<pre>
border-top: thin solid black;
border-bottom: thin solid black;
border-clip-top: 10px;
border-clip-bottom: 10px;
</pre>
<div style="position: relative; width: 250px; height: 150px; background:
white;">
<div style="border: 2px solid black; width: 200px; height: 100px;
position: absolute; top: 20px; left: 20px">
<div style="position: absolute; background: white; left: 15px; top:
-5px; height: 110px; width: 200px"></div>
<div style="position: absolute; background: white; left: -5px; top: 0px;
height: 100px; width: 210px"></div>
</div>
</div>
</div>
<div class=example>
<pre>
border-top: thin solid black;
border-clip: 10px;
</pre>
<div style="position: relative; width: 250px; height: 150px; background:
white;">
<div style="border: 2px solid black; width: 200px; height: 100px;
position: absolute; top: 20px; left: 20px">
<div style="position: absolute; background: white; left: 15px; top:
-5px; height: 110px; width: 200px"></div>
<div style="position: absolute; background: white; left: -5px; top: 0px;
height: 110px; width: 210px"></div>
</div>
</div>
</div>
<div class=example>
<p>This rendering:
<div style="background: white; padding: 0.2em 0.5em">
<pre style="margin-left: 0">
A sentence consists of words¹.
</pre>
<div style="width: 3em; height: 2px; background: black"></div>
<pre style="margin-left: 0">
¹ Most often.
</pre>
</div>
can be achieved with this style sheet:
<pre>
@footnote {
border-top: thin solid black;
border-clip: 4em;
}
</pre>
</div>
<div class=example>
<pre>
border: 2px solid black;
border-top-parts: repeat(10px 10px);
</pre>
<p>In this example, the repeat pattern is shown five times and there is,
by coincidence, no remaining border.
<div style="position: relative; width: 100px; background: white; padding:
20px">
<div style="border: 2px solid black; height: 40px"></div>
<div style="position: absolute; background: white; width: 10px; height:
2px; top: 20px; left: 30px"></div>
<div style="position: absolute; background: white; width: 10px; height:
2px; top: 20px; left: 50px"></div>
<div style="position: absolute; background: white; width: 10px; height:
2px; top: 20px; left: 70px"></div>
<div style="position: absolute; background: white; width: 10px; height:
2px; top: 20px; left: 90px"></div>
<div style="position: absolute; background: white; width: 10px; height:
2px; top: 20px; left: 110px"></div>
</div>
</div>
<div class=example>
<pre>
border: 2px solid black;
border-top-parts: repeat(10px 10px);
</pre>
<p>In this example, the repeat pattern is shown five times. The box in
this example is slightly wider than the box in the previous example. The
remaining border is taken up by a fraction, as if this code had been
specified:
<pre>
border: 2px solid black;
border-top-parts: repeat(10px 10px) 1fr;
</pre>
<div style="position: relative; width: 105px; background: white; padding:
20px">
<div style="border: 2px solid black; height: 40px"></div>
<div style="position: absolute; background: white; width: 10px; height:
2px; top: 20px; left: 30px"></div>
<div style="position: absolute; background: white; width: 10px; height:
2px; top: 20px; left: 50px"></div>
<div style="position: absolute; background: white; width: 10px; height:
2px; top: 20px; left: 70px"></div>
<div style="position: absolute; background: white; width: 10px; height:
2px; top: 20px; left: 90px"></div>
<div style="position: absolute; background: white; width: 10px; height:
2px; top: 20px; left: 110px"></div>
<div style="position: absolute; background: red; width: 5px; height: 2px;
top: 20px; left: 120px"></div>
</div>
<p>The fragment is shown in red for illustrative purposes; it should be
shown in black by a compliant UA.
</div>
<div class=example>
<pre>
border: 4px solid black;
border-top-parts: 40px 20px 0 1fr repeat(20px 20px) 0 1fr 40px;
</pre>
<p>In this example, there will be a visible 40px border part on each end
of the top border. Inside the 40px border parts, there will be an
invisible border part of at least 20px. Inside these invisible border
parts, there will be visible border parts, each 20px long with 20px
invisible border parts between them.
<div style="position: relative; width: 192px; background: white; padding:
40px">
<div style="border: 4px solid black; height: 40px"></div>
<div style="position: absolute; background: white; width: 20px; height:
4px; top: 40px; left: 80px"></div>
<div style="position: absolute; background: red; width: 6px; height: 4px;
top: 40px; left: 100px"></div>
<div style="position: absolute; background: white; width: 20px; height:
4px; top: 40px; left: 126px"></div>
<div style="position: absolute; background: white; width: 20px; height:
4px; top: 40px; left: 166px"></div>
<div style="position: absolute; background: red; width: 6px; height: 4px;
top: 40px; left: 186px"></div>
</div>
<p>The fragments are shown in red for illustrative purposes; they should
not be visible in compliant UAs.
</div>
<div class=example>
<pre>
border: 4px solid black;
border-top-parts: 40px 20px 0 1fr 20px 20px 0 1fr 40px;
</pre>
<p>In this example, there will be a visible 40px border part on each end
of the top border. Inside the 40px border parts, there will be an
invisible border part of at least 20px. Inside these invisible border
parts, there will be visible border parts, each 20px long with 20px
invisible border parts between them.
<div style="position: relative; width: 192px; background: white; padding:
40px">
<div style="border: 4px solid black; height: 40px"></div>
<div style="position: absolute; background: white; width: 20px; height:
4px; top: 40px; left: 80px"></div>
<div style="position: absolute; background: red; width: 6px; height: 4px;
top: 40px; left: 100px"></div>
<div style="position: absolute; background: white; width: 20px; height:
4px; top: 40px; left: 126px"></div>
<div style="position: absolute; background: white; width: 20px; height:
4px; top: 40px; left: 166px"></div>
<div style="position: absolute; background: red; width: 6px; height: 4px;
top: 40px; left: 186px"></div>
</div>
<p>The fragments are shown in red for illustrative purposes; they should
not be visible in compliant UAs.
</div>
<div class=example>
<pre>
border: 4px solid black;
border-clip-top: 3fr 10px 2fr 10px 1fr 10px 10px 10px 1fr 10px 2fr 10px 3fr;
</pre>
<p>All but one of the visible border parts are represented as fractions in
this example. The length of these border parts will change when the width
of the element changes. Here is one rendering where 1fr ends up being
10px:
<div style="position: relative; width: 190px; background: white; padding:
40px">
<div style="border: 4px solid black; border-top: none; height: 40px"></div>
<div style="position: absolute; background: red; width: 30px; height:
4px; top: 40px; left: 40px"></div>
<div style="position: absolute; background: white; width: 10px; height:
4px; top: 40px; left: 70px"></div>
<div style="position: absolute; background: red; width: 20px; height:
4px; top: 40px; left: 80px"></div>
<div style="position: absolute; background: white; width: 10px; height:
4px; top: 40px; left: 100px"></div>
<div style="position: absolute; background: red; width: 10px; height:
4px; top: 40px; left: 110px"></div>
<div style="position: absolute; background: white; width: 10px; height:
4px; top: 40px; left: 120px"></div>
<div style="position: absolute; background: black; width: 10px; height:
4px; top: 40px; left: 130px"></div>
<div style="position: absolute; background: white; width: 10px; height:
4px; top: 40px; left: 140px"></div>
<div style="position: absolute; background: red; width: 10px; height:
4px; top: 40px; left: 150px"></div>
<div style="position: absolute; background: white; width: 10px; height:
4px; top: 40px; left: 160px"></div>
<div style="position: absolute; background: red; width: 20px; height:
4px; top: 40px; left: 170px"></div>
<div style="position: absolute; background: white; width: 10px; height:
4px; top: 40px; left: 190px"></div>
<div style="position: absolute; background: red; width: 30px; height:
4px; top: 40px; left: 200px"></div>
</div>
<p>Here is another rendering where 1fr ends up being 30px:
<div style="position: relative; width: 440px; background: white; padding:
40px">
<div style="border: 4px solid black; border-top: none; height: 40px"></div>
<div style="position: absolute; background: red; width: 90px; height:
4px; top: 40px; left: 40px"></div>
<div style="position: absolute; background: white; width: 10px; height:
4px; top: 40px; left: 130px"></div>
<div style="position: absolute; background: red; width: 60px; height:
4px; top: 40px; left: 140px"></div>
<div style="position: absolute; background: white; width: 10px; height:
4px; top: 40px; left: 200px"></div>
<div style="position: absolute; background: red; width: 30px; height:
4px; top: 40px; left: 210px"></div>
<div style="position: absolute; background: white; width: 10px; height:
4px; top: 40px; left: 240px"></div>
<div style="position: absolute; background: black; width: 10px; height:
4px; top: 40px; left: 250px"></div>
<div style="position: absolute; background: white; width: 10px; height:
4px; top: 40px; left: 260px"></div>
<div style="position: absolute; background: red; width: 30px; height:
4px; top: 40px; left: 270px"></div>
<div style="position: absolute; background: white; width: 10px; height:
4px; top: 40px; left: 300px"></div>
<div style="position: absolute; background: red; width: 60px; height:
4px; top: 40px; left: 310px"></div>
<div style="position: absolute; background: white; width: 10px; height:
4px; top: 40px; left: 370px"></div>
<div style="position: absolute; background: red; width: 90px; height:
4px; top: 40px; left: 390px"></div>
</div>
<p>The fragments are shown in red for illustrative purposes; they should
be black in compliant UAs.
</div>
<h2 id=definitions><span class=secno>6. </span>Definitions</h2>
<h3 id=glossary><span class=secno>6.1. </span>Glossary</h3>
<p>The following terms and abbreviations are used in this module.
<dl>
<dt><dfn id=ua>UA</dfn>
<dt><dfn id=user-agent>User Agent</dfn>
<dd>
<p>A program that reads and/or writes CSS style sheets on behalf of a
user in either or both of these categories: programs whose purpose is to
render <a href="#document">documents</a> (e.g., browsers) and programs
whose purpose is to create style sheets (e.g., editors). A UA may fall
into both categories. (There are other programs that read or write style
sheets, but this module gives no rules for them.)
<dt><dfn id=document title="document|documents">document</dfn>
<dd>
<p>A tree-structured document with elements and attributes, such as an
SGML or XML document <a href="#XML11"
rel=biblioentry>[XML11]<!--{{XML11}}--></a>.
<dt><dfn id=style-sheet>style sheet</dfn>
<dd>
<p>A <a href="http://www.w3.org/TR/CSS21/conform.html#style-sheet">CSS
style sheet</a>.
</dl>
<h3 id=conformance><span class=secno>6.2. </span>Conformance</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. All of the text of this specification is
normative except sections explicitly marked as non-normative, examples,
and notes. <a href="#RFC2119"
rel=biblioentry>[RFC2119]<!--{{!RFC2119}}--></a>
<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:
<div class=example>
<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 class=note>Note, this is an informative note.
<p>Conformance to CSS Backgrounds and Borders Level 3 is defined for three
classes:
<dl>
<dt><dfn id=style-sheet0 title="style sheet!!as conformance class">style
sheet</dfn>
<dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#style-sheet">CSS
style sheet</a>.
<dt><dfn id=renderer>renderer</dfn>
<dd>A UA that interprets the semantics of a style sheet and renders <a
href="#document">documents</a> that use them.
<dt><dfn id=authoring-tool>authoring tool</dfn>
<dd>A UA that writes a style sheet.
</dl>
<p>A style sheet is conformant to CSS Backgrounds and Borders Level 3 if
all of its declarations that use properties defined in this module have
values that are valid according to the generic CSS grammar and the
individual grammars of each property as given in this module.
<p>A renderer is conformant to CSS Backgrounds and Borders Level 3 if, in
addition to interpreting the style sheet as defined by the appropriate
specifications, it supports all the properties defined by CSS Backgrounds
and Borders Level 3 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>An authoring tool is conformant to CSS Backgrounds and Borders Level 3
if it writes syntactically correct style sheets, according to the generic
CSS grammar and the individual grammars of each property in this module.
<h3 id=levels><span class=secno>6.3. </span>Levels</h3>
<p><em>This section is informative.</em> CSS has different levels of
features, each a subset of the other. (See <a href="#CSSBEIJING"
rel=biblioentry>[CSSBEIJING]<!--{{CSSBEIJING}}--></a> for a full
explanation.) The lists below describe which features from this
specification are in each level.
<h4 id=level-1><span class=secno>6.3.1. </span>CSS Level 1</h4>
<ul>
<li>‘<code class=property>background-color</code>’
<li>‘<code class=property>background-image</code>’ only one
image (no layers)
<li>‘<code class=property>background-repeat</code>’: only
‘<code class=property>repeat</code>’ | ‘<code
class=property>repeat-x</code>’ | ‘<code
class=property>repeat-y</code>’ | ‘<code
class=property>no-repeat</code>’
<li>‘<code class=property>background-attachment</code>’: only
‘<code class=property>scroll</code>’ | ‘<code
class=property>fixed</code>’
<li>‘<code class=property>background-position</code>’: only
one or two values allowed
<li>‘<code class=property>background</code>’ shorthand: only
color, image, repeat, attachment and position
<li>‘<code class=property>border-color</code>’ properties
<li>‘<code class=property>border-style</code>’ properties
<li>‘<code class=property>border-width</code>’ properties
<li>‘<code class=property>border-top</code>’, ‘<code
class=property>border-bottom</code>’, ‘<code
class=property>border-right</code>’, ‘<code
class=property>border-left</code>’, and ‘<code
class=property>border</code>’ shorthands
</ul>
<h4 id=level-2><span class=secno>6.3.2. </span>CSS Level 2</h4>
<ul>
<li>‘<code class=property>background-color</code>’
<li>‘<code class=property>background-image</code>’: only one
image (no layers)
<li>‘<code class=property>background-repeat</code>’: only
‘<code class=property>repeat</code>’ | ‘<code
class=property>repeat-x</code>’ | ‘<code
class=property>repeat-y</code>’ | ‘<code
class=property>no-repeat</code>’
<li>‘<code class=property>background-attachment</code>’: only
‘<code class=property>scroll</code>’ | ‘<code
class=property>fixed</code>’
<li>‘<code class=property>background-position</code>’: only
one or two values allowed
<li>‘<code class=property>background</code>’: only color,
image, repeat, attachment and position
<li>‘<code class=property>border-color</code>’ properties
<li>‘<code class=property>border-style</code>’ properties
<li>‘<code class=property>border-width</code>’ properties
<li>‘<code class=property>border-top</code>’, ‘<code
class=property>border-bottom</code>’, ‘<code
class=property>border-right</code>’, ‘<code
class=property>border-left</code>’, and ‘<code
class=property>border</code>’ shorthands
</ul>
<h4 id=level-3><span class=secno>6.3.3. </span>CSS Level 3</h4>
<ul>
<li>All features described in the CSS Backgrounds and Borders Module Level
3
</ul>
<h3 id=exit><span class=secno>6.4. </span>CR exit criteria</h3>
<p>As described in the W3C process document, a <a
href="http://www.w3.org/2005/10/Process-20051014/tr.html#cfi">Candidate
Recommendation</a> (CR) is a specification that W3C recommends for use on
the Web. The next stage is “Recommendation,” when the specification is
sufficiently implemented.
<p>For this specification to be proposed as a W3C Recommendation, the
following conditions shall be met. There must be at least two independent,
interoperable implementations of each feature. Each feature may be
implemented by a different set of products, there is no requirement that
all features be implemented by a single product. For the purposes of this
criterion, we define the following terms:
<dl>
<dt>independent
<dd>each implementation must be developed by a different party and cannot
share, reuse, or derive from code used by another qualifying
implementation. Sections of code that have no bearing on the
implementation of this specification are exempt from this requirement.
<dt>interoperable
<dd>passing the respective test case(s) in the official CSS test suite,
or, if the implementation is not a Web browser, an equivalent test. Every
relevant test in the test suite should have an equivalent test created if
such a user agent (UA) is to be used to claim interoperability. In
addition if such a UA is to be used to claim interoperability, then there
must one or more additional UAs which can also pass those equivalent
tests in the same way for the purpose of interoperability. The equivalent
tests must be made publicly available for the purposes of peer review.
<dt>implementation
<dd>a user agent which:
<ol class=inline>
<li>implements the specification.
<li>is available to the general public. The implementation may be a
shipping product or other publicly available version (i.e., beta
version, preview release, or “nightly build”). Non-shipping product
releases must have implemented the feature(s) for a period of at least
one month in order to demonstrate stability.
<li>is not experimental (i.e., a version specifically designed to pass
the test suite and is not intended for normal usage going forward).
</ol>
</dl>
<p>A minimum of sixth months of the CR period must have elapsed. This is to
ensure that enough time is given for any remaining major errors to be
caught.
<p>Features will be dropped if two or more interoperable implementations
are not found by the end of the CR period.
<p>Features may/will also be dropped if adequate/sufficient (by judgment of
CSS WG) tests have not been produced for those feature(s) by the end of
the CR period.
<h2 id=acknowledgments><span class=secno>7. </span>Acknowledgments</h2>
<h2 id=references><span class=secno>8. </span>References</h2>
<h3 class=no-num id=normative-references>Normative references</h3>
<!--begin-normative-->
<!-- Sorted by label -->
<dl class=bibliography>
<dt style="display: none"><!-- keeps the doc valid if the DL is empty -->