You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>The 'list-style' property is a shorthand notation for setting the
457
-
three properties 'list-style-type', 'list-style-image', and 'list-style-position'
458
-
at the same place in the style sheet.
456
+
<p>
457
+
The 'list-style' property is a shorthand notation
458
+
for setting the three properties 'list-style-type', 'list-style-image', and 'list-style-position'
459
+
at the same place in the style sheet.
459
460
460
461
<divclass="example">
461
-
<p>For example:
462
+
<p>
463
+
For example:
462
464
463
-
<pre>
464
-
UL { list-style: upper-roman inside } /* Any UL */
465
-
UL UL { list-style: circle outside } /* Any UL child of a UL */
466
-
</pre>
465
+
<pre>
<!--
466
+
-->UL { list-style: upper-roman inside } /* Any UL */
<!--
467
+
-->UL UL { list-style: circle outside } /* Any UL child of a UL */</pre>
467
468
</div>
468
469
469
-
<p>Using a value of ''none'' in the shorthand is potentially ambiguous, as ''none'' is a valid value for both 'list-style-image' and 'list-style-type'. To resolve this ambiguity, a value of ''none'' in the shorthand must be applied to whichever of the two properties aren't otherwise set by the shorthand.
470
+
<p>
471
+
Using a value of ''none'' in the shorthand is potentially ambiguous,
472
+
as ''none'' is a valid value for both 'list-style-image' and 'list-style-type'.
473
+
To resolve this ambiguity,
474
+
a value of ''none'' in the shorthand must be applied to whichever of the two properties aren't otherwise set by the shorthand.
470
475
471
476
<divclass='example'>
472
-
<pre>
473
-
list-style: none disc;
474
-
/* Sets the image to "none" and the type to "disc". */
475
-
476
-
list-style: none url(bullet.png);
477
-
/* Sets the image to "url(bullet.png)" and the type to "none". */
478
-
479
-
list-style: none;
480
-
/* Sets both image and type to "none". */
481
-
482
-
list-style: none disc url(bullet.png);
483
-
/* Syntax error */</pre>
477
+
<pre><!--
478
+
-->list-style: none disc;
<!--
479
+
-->/* Sets the image to "none" and the type to "disc". */
<!--
480
+
-->
<!--
481
+
-->list-style: none url(bullet.png);
<!--
482
+
-->/* Sets the image to "url(bullet.png)" and the type to "none". */
<!--
483
+
-->
<!--
484
+
-->list-style: none;
<!--
485
+
-->/* Sets both image and type to "none". */
<!--
<p>Although authors may specify 'list-style' information directly on list item elements (e.g., LI in HTML), they should do so with care. Consider the following rules:
487
491
488
492
<divclass=example>
489
-
<pre>
490
-
ol.alpha li { list-style: lower-alpha; }
491
-
ul li { list-style: disc; }
492
-
/* These won't work as expected. If you nest a <ul>
493
-
into an <ol class=alpha>, the first rule's specificity
494
-
will make the <ul>'s list items use the lower-alpha style. */
495
-
496
-
ol.alpha > li { list-style: lower-alpha; }
497
-
ul > li { list-style: disc; }
498
-
/* These work as intended. */
499
-
500
-
ol.alpha { list-style: lower-alpha; }
501
-
ul { list-style: disc; }
502
-
/* So do these, since inheritance will transfer the
503
-
'list-style' value to the list items. */</pre>
493
+
<p>
494
+
Although authors may specify 'list-style' information directly on list item elements
495
+
(e.g., <code><li></code> in HTML),
496
+
they should do so with care.
497
+
Consider the following rules:
498
+
499
+
<pre><!--
500
+
-->ol.alpha li { list-style: lower-alpha; }
<!--
501
+
-->ul li { list-style: disc; }</pre>
502
+
503
+
<p>
504
+
The above won't work as expected.
505
+
If you nest a <code><ul></code> into an <code><ol class=alpha></code>,
506
+
the first rule's specificity will make the <code><ul></code>'s list items use the lower-alpha style.
507
+
508
+
<pre><!--
509
+
-->ol.alpha > li { list-style: lower-alpha; }
<!--
510
+
-->ul > li { list-style: disc; }</pre>
511
+
512
+
<p>
513
+
These work as intended.
514
+
515
+
<pre><!--
516
+
-->ol.alpha { list-style: lower-alpha; }
<!--
517
+
-->ul { list-style: disc; }</pre>
518
+
519
+
<p>
520
+
These are even better,
521
+
since inheritance will transfer the 'list-style' value to the list items.
0 commit comments