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
and all children of the OL will refer to that counter.
1174
1210
</div>
1175
1211
1176
-
<p>
1177
-
The self-nesting is based on the principle that every element or pseudo-element that has a 'counter-reset' for a counter X,
1178
-
creates a fresh counter X,
1179
-
the <dfnid="counter-scope" title="scope|counter scope">scope</dfn> of which is the element or pseudo-element,
1180
-
its following siblings up to but not including the first one that resets the same counter,
1181
-
and all the descendants of those elements.
1182
1212
1183
-
<p>Additionally, if an element has a 'counter-set' or 'counter-increment' for a counter that is not in scope for the element, it establishes a scope for that counter identically to if 'counter-reset' were used on the element to reset the counter to ''0''.
1184
-
1185
-
<p>In the example above, an OL will create a counter, and all children of the OL will refer to that counter.
1186
-
1187
-
<divclass="html-example">
1213
+
<divclass="example">
1188
1214
1189
-
<p>If we denote by item[<var>n</var>] the <var>n</var><sup>th</sup> instance of the "item" counter, and by "(" and ")"the beginning and end of a scope, then the following HTML fragment will use the indicated counters. (We assume the style sheet as given in the example above).
1215
+
<p>
1216
+
If we denote by item[<var>n</var>] the <var>n</var><sup>th</sup> instance of the "item" counter,
1217
+
and by "(" and ")"the beginning and end of a scope,
1218
+
then the following HTML fragment will use the indicated counters.
1219
+
(We assume the style sheet as given in the example above).
1190
1220
1191
1221
<pre>
1192
1222
<OL> <!-- (set item[0] to 0 -->
@@ -1209,18 +1239,9 @@ <h3 id="nested-counters">
1209
1239
<LI>item <!-- increment item[4] to 1 -->
1210
1240
<LI>item <!-- increment item[4] to 2 -->
1211
1241
</OL> <!-- ) --></pre>
1212
-
</div>
1213
-
1214
-
<p>As explained in a later section, the ''counter()'' function generates a string based off of the innermost scope of the named counter, while the ''counters()'' function generates a string based on the values of <em>all</em> the in-scope counters with a given name.
1215
1242
1216
-
<divclass="example"><p>
1217
-
<p>The following style sheet numbers nested list items
0 commit comments