-
Notifications
You must be signed in to change notification settings - Fork 790
Expand file tree
/
Copy pathOverview.src.html
More file actions
1269 lines (1067 loc) · 38.5 KB
/
Overview.src.html
File metadata and controls
1269 lines (1067 loc) · 38.5 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 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
<title>CSS Lists and Counters Module Level 3</title>
<meta charset=utf-8>
<link rel="stylesheet" type="text/css" href="../default.css">
<style type="text/css">
td, th { padding: 0 0.5em; }
.numbering td, .numbering th { vertical-align: top; }
.mapping th { text-align: right; }
.mapping td { text-align: center; }
.roman-example { padding: 0.75em; background: white; color: black; margin: 0.25em 0; display: block; }
.hebrew { display: block; }
.hebrew-example thead { display: none; }
.hebrew-example tbody { display: table; float: left; margin: 1em 2em 0.5em; }
.hebrew-example tr > :first-child { text-align: right; }
.hebrew-example tr > :last-child { text-align: left; }
.hebrew-example + * { clear: both; }
</style>
<link rel="stylesheet" type="text/css" href="http://www.w3.org/StyleSheets/TR/W3C-ED">
</head><body>
<div class="head">
<!--logo-->
<h1>CSS Lists and Counters Module Level 3</h1>
<h2 class="no-num no-toc">[LONGSTATUS] [DATE]</h2>
<dl>
<dt>This version:
<dd><!-- <a href="http://www.w3.org/TR/[YEAR]/WD-[SHORTNAME]-[CDATE]">http://www.w3.org/TR/[YEAR]/WD-[SHORTNAME]-[CDATE]</a></dd> -->
<a href="http://dev.w3.org/csswg/css3-lists">http://dev.w3.org/csswg/css3-lists</a></dd>
<dt>Latest Working Draft:
<dd><a href="http://www.w3.org/TR/css3-lists">[LATEST]</a></dd>
<dt>Previous versions:</dt>
<dd><a href="http://www.w3.org/TR/2002/WD-css3-lists-20021107">http://www.w3.org/TR/2002/WD-css3-lists-20021107</a></dd>
<dt>Editor:</dt>
<dd><a href="http://www.xanthir.com/contact">Tab Atkins Jr.</a></dd>
<dt>Previous Editors:</dt> <!-- in the order tantek requested -->
<dd>Ian Hickson, <a href="mailto:ian@hixie.ch">ian@hixie.ch</a></dd>
<dd><span lang="tr">Tantek Çelı̇k</span>, Microsoft Corporation,
<a href="mailto:tantekc@microsoft.com">tantekc@microsoft.com</a></dd>
<dt>Contributors:</dt> <!-- in order of volume of input -->
<dd>Simon Montagu, AOL-TW/Netscape, <a href="mailto:smontagu@netscape.com">smontagu@netscape.com</a></dd>
<dd>Daniel Yacob, <a href="mailto:yacob@geez.org">yacob@geez.org</a></dd>
<dd>Christopher Hoess, <a href="mailto:choess@stwing.upenn.edu">choess@stwing.upenn.edu</a></dd>
<dd>Daniel Glazman, AOL-TW/Netscape, <a href="mailto:glazman@netscape.com">glazman@netscape.com</a></dd>
</dl>
<!--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 documents
(such as HTML and XML) on screen, on paper, in speech, etc.
This draft contains the features of CSS level 3 relating to
list styling. It includes and extends the functionality of
CSS level 2 [[!CSS21]], which builds on CSS level 1
[[CSS1]]. The main extensions compared to level 2 are
<span class="issue">summarize here</span>.
<h2 class="no-num no-toc" id="status">Status of this document</h2>
<!--status-->
<h2 class="no-num no-toc" id="contents">Table of contents</h2>
<!--toc-->
<hr>
<h2>Introduction</h2>
<p>The list model in this module differs in some important ways from the list model in CSS2,
specifically in its handling of markers. Implementation experience suggested the CSS2 model
overloaded the ::before and ::after pseudo-elements with too much behavior, while at the same time
introducing new properties when existing properties were sufficient.</p>
<p>Most block-level elements in CSS generate one principal block box. In this module, we discuss two
CSS mechanisms that cause an element to have an associated marker: one method associates one
principal block box (for the element's content) with a separate marker box (for decoration such as a
bullet, image, or number), and the other inserts a marker box into the principal box. Unlike :before
and :after content, the marker box cannot affect the position of the principal box, whatever the
positioning scheme.</p>
<div class="html-example">
<p>For instance, the following example illustrates how markers may be used to add parentheses around
each numbered list item. This HTML application and style sheet:</p>
<pre>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<HTML>
<HEAD>
<TITLE>Creating a list with markers</TITLE>
<STYLE type="text/css">
LI::marker { content: "(" counter(list-item, lower-roman) ")"; }
LI { display: list-item; }
</STYLE>
</HEAD>
<BODY>
<OL>
<LI> This is the first item. </LI>
<LI> This is the second item. </LI>
<LI> This is the third item. </LI>
</OL>
</BODY>
</HTML>
</pre>
<p>should produce something like this: </p>
<pre>
(i) This is the first item.
(ii) This is the second item.
(iii) This is the third item.
</pre>
</div>
<p>With descendant selectors and child selectors, it's possible to specify different marker types
depending on the depth of embedded lists.</p>
<p class="issue">A future release of this module will probably include ways to render tree
lists.</p>
<h2>Declaring a List Item</h2>
<p>To declare a list item, the 'display'
property should be set to &
CB9A
#039;'list-item''. This, in addition to generating
a ''::marker'' pseudo-element and enabling the
properties described below for that element, causes that element to
increment the list item counter ''list-item''.
(This does not affect the specified or computed values of the counter
properties.)</p>
<p>The ''list-item'' counter is a real counter,
and can be directly affected using the 'counter-increment' and ''counter-reset''
properties. It can also be used in the ''counter()'' and ''counters()'' functions.</p>
<p class="issue">The CSS3 box module may define other 'display' values which generate a list
marker. These should also affect the ''list-item'' counter.</p>
<p>Note that this new model makes the ''marker''
display type redundant. That display type is therefore obsolete in the
CSS3 Lists model.</p>
<!-- ====================================================================== -->
<h2 id=list-style-type-property>List Content: The 'list-style-type' property</h2>
<table class="propdef">
<tr>
<th>Name:
<td><dfn>list-style-type</dfn>
<tr>
<th>Value:
<td><b><string></b> | <b><counter-style></b> | none
<tr>
<th>Initial:
<td>disc
<tr>
<th>Applies To:
<td>all elements with ''display: list-item''
<tr>
<th>Inherited:
<td>yes
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed Value:
<td>specified value
</table>
<p>This property specifies the default contents of the list item
marker if 'list-style-image' has the
value 'none' or if the image pointed to by the URI cannot be
displayed. The value 'none' specifies no marker, and a string value uses the
given string; otherwise, the value specifies a <b><counter-style></b> which
is used to format the value of the ''list-item'' counter.</p>
<dl>
<dt><string></dt>
<dd>The ''::marker'' pseudoelement must use the provided string as its default
contents.</dd>
<dt>none</dt>
<dd>The ''::marker'' pseudoelement must have no default contents. This will
suppress the creation of a marker unless the ''::marker'' has its contents
specified directly through the 'content' property.</dd>
<dt><counter-style></dt>
<dd>
<p>The ''::marker'' pseudoelement's default contents must be the value of
the ''list-item'' counter, formatted according to the given counter style.
Algorithms for formatting a value according to a counter style are given
later in this spec.</p>
<p>The <b>UA style sheet</b> given later in this spec provides a large list
of counter style definitions, and authors or users may define their own
counter styles as well.</p>
</dd>
</dl>
<!-- ====================================================================== -->
<h2 id=predefined-counters>Predefined Counter Styles</h2>
<p>While authors may define their own counter styles using the ''@counter-style''
rule defined in this spec, there are many counter styles that CSS already defined
in previous levels, and many more that can be usefully predefined. Appendix A
contains a required UA stylesheet which defines a large number of counter styles
using the ''@counter-style'' rule. A few styles require special handling beyond
what can be expressed in a stylesheet, though. Those counter styles are described
in this section.
<h3 id=decimal-counters>The ''decimal'' counter style</h3>
<p>The ''decimal'' counter style is the default fallback counter style for the
''@counter-style'' rule, and is also used in extraordinary situations like fallback
loop. As such, it has to be well-defined at all times, so that a counter can
always be formatted regardless of the validity of the defined counter styles.</p>
<p>UAs must not allow the definition of the ''decimal'' counter style given in
Appendix A to be overridden.</p>
<h3 id=glyph-counters>Glyphs</h3>
<p>CSS 2.1 defined three single-glyph counter styles (''circle'', ''disc'', and
''square''), but didn't define precisely how to render them, instead opting to
describe generally how they should look and leaving it up to the UA to decide how
to render the markers.</p>
<p>Appendix A gives normative definitions for these styles, but UAs may instead
default to rendering these styles using a browser-generated image matching the
description below. If the styles are overridden, the new style must be honored;
this relaxation of the rendering requirements applies only to the default value
of each counter style.</p>
<p>If the UA chooses to use an image for the default rendering of these counter
styles, the image must be scalable and designed to attractively fill a box 1em
wide and 1em tall.</p>
<dl>
<dt>circle</dt>
<dd>A hollow circle, similar to ◦ U+25E6 WHITE BULLET.</dd>
<dt>disc</dt>
<dd>A filled circle, similar to • U+2022 BULLET.</dd>
<dt>square</dt>
<dd>A filled square, similar to ■ U+25A0 BLACK SQUARE.</dd>
</dl>
<h3 id=complex-counters>Complex counter styles</h3>
<p>Some real-life counter styles are unfortunately too complex to be accurately
described using the ''@counter-style'' rule. The following styles must be supported
as default counter styles as if they were defined by theoretical
''@counter-style'' rules placed at the end of the UA stylesheet defined in Appendix
A, using the given name as the counter style name and the given algorithm to format
counter values. They must be overrideable like any other predefined counter style.</p>
<dl>
<dt>hebrew</dt>
<dd>
<p>This is a simple additive system defined for the range 1 to 999999.
The digits are split into two groups of three. Within each group,
appropriate digits are picked from the following list (at most one per
column) and written in descending order by value (hundreds first). If
there is more than one group, the first group is followed by U+05F3 HEBREW
PUNCTUATION GERESH.</p>
<table>
<caption>Hebrew numbering system</caption>
<thead>
<tr>
<th colspan="3">Hundreds
<th colspan="3">Tens
<th colspan="3">Units
<tr>
<th>Values
<th colspan="2">Codepoints
<th>Values
<th colspan="2">Codepoints
<th>Values
<th colspan="2">Codepoints
<tbody>
<tr>
<td>100
<td>ק
<td>U+05E7
<td>10
<td>י
<td>U+05D9
<td>1
<td>א
<td>U+05D0
<tr>
<td>200
<td>ר
<td>U+05E8
<td>20
<td>כ
<td>U+05DB
<td>2
<td>ב
<td>U+05D1
<tr>
<td>300
<td>ש
<td>U+05E9
<td>30
<td>ל
<td>U+05DC
<td>3
<td>ג
<td>U+05D2
<tr>
<td>400
<td>ת
<td>U+05EA
<td>40
<td>מ
<td>U+05DE
<td>4
<td>ד
<td>U+05D3
<tr>
<td>500
<td>תק
<td>U+05EA U+05E7
<td>50
<td>נ
<td>U+05E0
<td>5
<td>ה
<td>U+05D4
<tr>
<td>600
<td>תר
<td>U+05EA U+05E8
<td>60
<td>ס
<td>U+05E1
<td>6
<td>ו
<td>U+05D5
<tr>
<td>700
<td>תש
<td>U+05EA U+05E9
<td>70
<td>ע
<td>U+05E2
<td>7
<td>ז
<td>U+05D6
<tr>
<td>800
<td>תת
<td>U+05EA U+05EA
<td>80
<td>פ
<td>U+05E4
<td>8
<td>ח
<td>U+05D7
<tr>
<td>900
<td>תתק
<td>U+05EA U+05EA U+05E7
<td>90
<td>צ
<td>U+05E6
<td>9
<td>ט
<td>U+05D8
</table>
<p>If the last two digits of a group (when represented in decimal) are 15
or 16, they should be expressed not as יה U+05D9 U+05D4
(10+5) and יו U+05D9 U+05D5 (10+6), but as
טו U+05D8 U+05D5 (9+6) and טז U+05D8 U+05D6
(9+7). This is done to avoid a close resemblance to the Tetragrammaton
(four-letter name of God) יהוה U+05D9 U+05D4
U+05D5 U+05D4. Although this convention is originally derived from
religious practice, it is universally used even in completely secular
contexts.</p>
<p>The numerical value of each letter is fixed and not determined by
position, so reordering a number group will not change its value. This
may be done when a number spells out a word with negative connotations.
For instance, 298, רצח U+05E8 U+05E6 U+05D7
(200+90+8), is the Hebrew for "murder", so it is sometimes written as
רחצ U+05E8 U+05D7 U+05E6 (200+8+90). Words are
sometimes similarly rearranged when a reordered form has especially
positive connotations, for example 18, יח U+05D9 U+05D7
(10+8) is often written as חי U+05D7 U+05D9 (8+10), the
Hebrew for "alive". Unlike the exception for 15 and 16, using the
regular form in these cases is not considered an error.</p>
<p>The suffix for the hebrew numbering system is a dot (. U+002E
FULL STOP).</p>
<p>Numbers outside the range of the Hebrew system are rendered using the
''decimal'' counter style.</p>
<div class="example">
<p>This table shows the decimal number in the first cell, and the
equivalent hebrew number in the second.</p>
<table class="hebrew-example">
<thead>
<tr>
<th>Decimal
<th>Hebrew
<tbody>
<tr>
<td>-3
<td>-3
<tr>
<td>-2
<td>-2
<tr>
<td>-1
<td>-1
<tr>
<td>0
<td>0
<tr>
<td>1
<td>א
<tr>
<td>2
<td>ב
<tr>
<td>3
<td>ג
<tr>
<td>4
<td>ד
<tr>
<td>5
<td>ה
<tbody>
<tr>
<td>97
<td>צז
<tr>
<td>98
<td>צח
<tr>
<td>99
<td>צט
<tr>
<td>100
<td>ק
<tr>
<td>101
<td>קא
<tr>
<td>944
<td>תתקמד
<tr>
<td>945
<td>תתקמה
<tr>
<td>946
<td>תתקמו
<tr>
<td>999
<td>תתקצט
<tbody>
<tr>
<td>1000
<td>א׳
<tr>
<td>1001
<td>א׳א
<tr>
<td>1998
<td>א׳תתקצח
<tr>
<td>1999
<td>א׳תתקצט
<tr>
<td>2000
<td>ב׳
<tr>
<td>2001
<td>ב׳א
<tr>
<td>2003
<td>ב׳ג
<tr>
<td>2748
<td>ב׳תשמח
<tr>
<td>2750
<td>ב׳תשנ
</table>
<p>This example (like all other examples) is non-normative. If one of
the numbers above is inconsistent with the rules described above, then
the example should be disregarded.</p>
</div>
</dd>
<dt>ethiopic-numeric</dt>
<dd>
<p>The Ethiopian numbering system is defined for all positive non-zero numbers.
The following algorithm converts decimal digits to ethiopic numbers.</p>
<ol>
<li>Split the number into groups of two digits, starting with the least
significant decimal digit.</li>
<li>Index each group sequentially, starting from the least significant
as group number zero.</li>
<li>If the group has an odd index (as given in the previous step) and
has the value 1, or if the group is the most significant one and has
the value 1, or if the group has the value zero, then remove the digit
(but leave the group, so it still has a separator appended below).</li>
<li>For each remaining digit, substitute the relevant ethiopic character
from the list below.
<table>
<caption>Ethiopic numbering system</caption>
<thead>
<tr>
<th colspan="3">Tens
<th colspan="3">Units
<tr>
<th>Values
<th colspan="2">Codepoints
<th>Values
<th colspan="2">Codepoints
<tbody>
<tr>
<td>10
<td>፲
<td>U+1372
<td>1
<td>፩
<td>U+1369
<tr>
<td>20
<td>፳
<td>U+1373
<td>2
<td>፪
<td>U+136A
<tr>
<td>30
<td>፴
<td>U+1374
<td>3
<td>፫
<td>U+136B
<tr>
<td>40
<td>፵
<td>U+1375
<td>4
<td>፬
<td>U+136C
<tr>
<td>50
<td>፶
<td>U+1376
<td>5
<td>፭
<td>U+136D
<tr>
<td>60
<td>፷
<td>U+1377
<td>6
<td>፮
<td>U+136E
<tr>
<td>70
<td>፸
<td>U+1378
<td>7
<td>፯
<td>U+136F
<tr>
<td>80
<td>፹
<td>U+1379
<td>8
<td>፰
<td>U+1370
<tr>
<td>90
<td>፺
<td>U+137A
<td>9
<td>፱
<td>U+1371
</table>
</li>
<li>For each group with an odd index (as given in the second step),
append ፻ U+137B.</li>
<li>For each group with an even index (as given in the second step),
except the group with number 0, append ፼ U+137C.</li>
<li>Concatenate the groups into one string.</li>
</ol>
<p>This system is defined for all numbers greater than zero. For zero and
negative numbers, the decimal system is used instead.</p>
<p>The suffix for the ethiopic-numeric numbering systems is a dot
(. U+002E FULL STOP). <span class="issue">Is there a better suffix
to use? <strong>The alphabetic ethiopic systems use a different
suffix.</strong></span></p>
<div class="example">
<p>The decimal number 100, in ethiopic, is ፻ U+137B <!-- odd --></p>
<p> The decimal number 78010092, in ethiopic, is
፸፰፻፩፼፻፺፪ U+1378
U+1370 U+137B <!-- 70 8 odd --> U+1369 U+137C <!-- 1 even --> U+137B
<!-- odd --> U+137A U+136A. <!-- 90 2 --></p>
<p> The decimal number 780000001092, in ethiopic, is
፸፰፻፩፼፻፼፻፺፪
U+1378 U+1370 U+137B <!-- 70 8 odd --> U+1369 U+137C <!-- 1 even -->
U+137B <!-- odd --> U+137C <!-- even --> U+137B <!-- odd --> U+137A
U+136A. <!-- 90 2 --></p>
</div>
</dd>
</dl>
<!-- ====================================================================== -->
<h2 id=list-style-image-property>List Content: The 'list-style-image' property</h2>
<table class="propdef">
<tr>
<th>Name:
<td><dfn>list-style-image</dfn>
<tr>
<th>Value:
<td><image> | none
<tr>
<th>Initial
<td>none
<tr>
<th>Applies To:
<td>all elements with ''display: list-item''
<tr>
<th>Inherited:
<td>yes
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed Value:
<td>specified value
</table>
<p>This property sets the image that will be used as the list item marker. When
the <b><image></b> resolves to a valid image, it is used as the default contents
of ''::marker'' instead of the value specified by 'list-style-type'.</p>
<p>If the value ''none'' is provided, or the <b><image></b> doesn't resolve
to a valid image, then the default contents are given by 'list-style-type' instead.</p>
<div class="example">
<p>The following example sets the marker at the beginning of each list item to
be the image "ellipse.png".</p>
<pre>LI { list-style-image: url("http://www.example.com/ellipse.png") }</pre>
</div>
<!-- ====================================================================== -->
<h2 id=content-property>List Content: Generating the computed value of the 'content' property</h2>
<p>If a ''::marker'' pseudo-element has its 'content' property set to ''normal'', the
following algorithm should be used to generate the computed value of the property.</p>
<ol>
<li>If the computed value of 'list-style-image' is not ''none'', and if the
image is valid, then the computed value of the 'content' property is the value
of the 'list-style-image' property.</li>
<li>Otherwise, if the computed value of 'list-style-type' is a string, then
the computed value of the 'content' property is that string.</li>
<li>Otherwise, if the computed value of 'list-style-type' is not ''none'', then
the computed value of the 'content' property is ''counter(list-item, <b><counter-style></b>)'',
where <b><counter-style></b> is the computed value of the 'list-style-type'
property, followed by a string that is the suffix for the counter style in question
(which may be empty).</li>
<li>Otherwise the computed value is ''none''.</li>
</ol>
<div class="example">
<p>Given the following style sheet:</p>
<pre>li { display: list-item; list-style-type: decimal /* initial value */; }
li::marker { content: normal /* initial value */; }</pre>
<p>And the following document fragment:</p>
<pre><li> List Item </li></pre>
<p>The computed value of the 'content' property on the ''::marker''
pseudo-element of the list item element is:</p>
<pre>counter(list-item, decimal) "."</pre>
</div>
<!-- ====================================================================== -->
<h2 id=list-style-position-property>Marker Position: The 'list-style-position' property</h2>
<table class="propdef">
<tr>
<th>Name:
<td><dfn>list-style-position</dfn>
<tr>
<th>Value:
<td>inside | hanging | outside
<tr>
<th>Initial:
<td>outside
<tr>
<th>Applies To:
<td>all elements with ''display: list-item''
<tr>
<th>Inherited:
<td>yes
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed Value:
<td>specified value
</table>
<p>This property specifies the position of the ''::marker'' pseudo-element's box
in the list item. Values have the following meanings:</p>
<dl>
<dt><dfn>inside</dfn></dt>
<dd>The ''::marker'' pseudo-element is an inline-block element placed immediately
before the ''::before'' pseudo-element in the list item's principle box, after
which the element's content flows. Note that if there is no inline content,
this will create a line box, just as content in an inline ''::before'' pseudo-element
would. Also note that all the properties that apply to inline elements apply
to the ''::marker'' pseudo-element in this state, and this ''::marker'' box
participates in the inline box model in the normal manner.</dd>
<dt><dfn>hanging</dfn></dt>
<dd>As ''inside'', except the marker is out-of-flow.
The marker must be positioned such that its "before" edge is aligned with the
"before" edge of the first line box in the list item, and its "end" edge is
flush with the "start" edge of the first line box in the list item.
<span class=note>Note that this causes the marker to still respond to the
'text-align' property, as the boundaries of line boxes depend on 'text-align'.</span></dd>
<dt><dfn>outside</dfn></dt>
<dd>As ''inside'', except the marker is out-of-flow.
The marker must be positioned such that its "before" edge is aligned with the
"before" edge of the list item. If the list item's parent box is ltr, the marker's
"end" edge must be flush with the list item's "start" edge; if the list item's
parent box is rtl, the marker's "start" edge must be flush with the list item's
"end" edge.</dd>
</dl>
<div class=issue>
<p>''hanging'' is meant to emulate what some browsers (IE8, Firefox, Opera)
did for the CSS2.1 "outside" value, with somewhat more detail.</p>
<p>''outside'' is meant to emulate what other browsers (Webkit, IE9) did for
the CSS2.1 "outside" value, again with more detail. There is a notable behavior
change, in that the markers pay attention to the container's direction, not
the list item. This arose from the "Requirements for bidi in HTML" group's
conclusions - in a mixed-direction list, right now it's impossible to determine
ahead of time which side of the container the gutter should go (to contain the
bullet). You have to put a gutter on both sides, even if all the items are
one direction, just in case.</p>
<p>I'm not sure exactly how to express what I want with the "out-of-flow" comment
in ''hanging'' and ''outside''. I want to change how it's positioned, but
without invoking the "positioned element" machinery. Is that good/possible?
I also don't want to interfere with the author actually setting 'position' on
''::marker''. All this, and the ''::marker'' should still be a child of the
list item in the box tree (otherwise the behavior is surprising).</p>
<p>How should I define "first line box" for ''hanging''? The marker is intended
to be "magically positioned" - does this invoke the same logic that Positioned
Layout defines, where it leaves behind an inline placeholder that will generate
a line box? If not, do I descend into children to find the first linebox?
If I do that, there's the possibility of conflict, if a list item contains a
list item, and both of their markers position off of the same linebox. The
consequences of this are well-defined, but is that okay? I get 3 different
behaviors out of the 3 hanging-like browsers.</p>
</div>
<p>Note that a marker is only generated if the computed value of the 'content'
property for the element's ''::marker'' pseudo-element is not ''inhibit''.</p>
<div class="html-example">
<p>For example:
<pre>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<HTML>
<HEAD>
<TITLE>Comparison of inside/outside position</TITLE>
<STYLE type="text/css">
UL { list-style: outside }
UL.compact { list-style: inside }
</STYLE>
</HEAD>
<BODY>
<UL>
<LI>first list item comes first</LI>
<LI>second list item comes second</LI>
</UL>
<HT>
<UL class="compact">
<LI>first list item comes first</LI>
<LI>second list item comes second</LI>
</UL>
</BODY>
</HTML>
</pre>
<p> The above example may be formatted as:</p>
<div class="figure">
<p><img id="img-list-inout" src="list-inout.gif" alt="list with bullets to the left of it and list with bullets inside"></p>
</div>
</div>
<p>In right-to-left text, the markers would have been on the right side of the box.</p>
<!-- ====================================================================== -->
<h2 id=list-style-property>The 'list-style' shorthand property</h2>
<table class="propdef">
<tr>
<th>Name:
<td><dfn>list-style</dfn>
<tr>
<th>Value:
<td><'list-style-type'> || <'list-style-position'> || <'list-style-image'>
<tr>
<th>Initial:
<td>N/A (shorthand property)
<tr>
<th>Applies To:
<td>all elements with ''display: list-item''
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed Value;
<td>N/A (shorthand property)
</table>
<p>The 'list-style' property is a shorthand notation for setting the
three properties 'list-style-type', 'list-style-image', and 'list-style-position'
at the same place in the style sheet.</p>
<div class="example">
<p>For example:</p>
<pre>
UL { list-style: upper-roman inside } /* Any UL */
UL > UL { list-style: circle outside } /* Any UL child of a UL */
</pre>
</div>
<p>Although authors may specify 'list-style' information directly on
list item elements (e.g., LI in HTML), they should do so with care. The following rules look
similar, but the first declares a descendant selector and the second a (more specific) child selector.</p>
<pre class="example">
OL.alpha LI { list-style: lower-alpha } /* Any LI descendant of an OL */
OL.alpha > LI { list-style: lower-alpha } /* Any LI child of an OL */
</pre>
<p>Authors who use only the descendant selector may not
achieve the results they expect. Consider the following rules:</p>
<pre class="html-example">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<HTML>
<HEAD>
<TITLE>WARNING: Unexpected results due to cascade</TITLE>
<STYLE type="text/css">
OL.alpha LI { list-style: lower-alpha }
UL LI { list-style: disc }
</STYLE>
</HEAD>
<BODY>
<OL class="alpha">
<LI>level 1
<UL>
<LI>level 2</LI>
</UL>
</LI>
</OL>
</BODY>
</HTML>
</pre>
<p>The desired rendering would have level 1 list items with 'lower-alpha' labels and level 2 items
with 'disc' labels. However, the cascading order will cause the first style rule (which includes
specific class information) to mask the second. The following rules solve the problem by employing a
child selector instead:</p>
<pre class="example">
OL.alpha > LI { list-style: lower-alpha }
UL LI { list-style: disc }
</pre>
<p>Another solution would be to specify 'list-style' information only
on the list type elements:
<pre class="example">
OL.alpha { list-style: lower-alpha }
UL { list-style: disc }
</pre>
<p>Inheritance will transfer the 'list-style' values from OL and UL
elements to LI elements. This is the recommended way to specify list style information.</p>
<div class="example">
<p> A URI value may be combined with any other value, as in:</p>
<pre>
UL { list-style: url("http://png.com/ellipse.png") disc }
</pre>
<p> In the example above, the 'disc' will be used when the image is unavailable.</p>
</div>
<p>A value of ''none'' for the 'list-style' property sets both 'list-style-type'
and 'list-style-image' to ''none'', because it sets the 'list-style-type' to ''none''
(that is the first value in the list), and the initial value of the 'list-style-image'
property, which isn't listed in that declaration, is ''none''. For this reason,</p>
<pre>
LI { list-style: none; }
</pre>
<p>will ensure that no list-item marker is displayed on LI elements, except if a value is explicitly
given to the 'content' property of the ''::marker'' pseudo-element. In general, the best way to ensure that no marker
is rendered is to not set the 'display' property to list-item.</p>
<!-- ====================================================================== -->
<h2 id=marker-pseudoelement>Markers: The ''::marker'' pseudo-element</h2>
<p>Markers are created by setting an element's 'display' property to
''list-item''. The ''list-item'' displ
44F1
ay type is, in every
other respect, identical to the ''block'' display type. The marker box is only
created if the computed value of the 'content' property for the pseudo-element
is not ''none''.</p>
<p>Just like other generated content, markers generate a box when they're created,
which has margins, border, padding, and everything else a box normally has. Markers
are placed at the beginning of their superior parent's content, immediately before
a ''::before'' pseudo-element on the same superior parent. Marker boxes are
inline-block by default, and so a value of ''auto'' for 'width'
resolves to the width of the marker's content.</p>
<div class="html-example">
<p>In the following example, the content is centered within a marker
box of a fixed width. This document:</p>
<pre>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<HTML>
<HEAD>
<TITLE>Content alignment in the marker box</TITLE>