@@ -162,6 +162,8 @@ Heading Structures: the heading pseudo-classes '':heading'', and '':heading()''<
162
162
matches an element which has a <a>heading level</a> , with respect to the
163
163
semantics defined by the document language (e.g. [[HTML5]] ).
164
164
165
+ The [=specificity=] of '':heading'' is that of a class.
166
+
165
167
<div class="example">
166
168
For example, the following sheet contains a rule applying to all heading
167
169
elements in the current page:
@@ -170,16 +172,26 @@ Heading Structures: the heading pseudo-classes '':heading'', and '':heading()''<
170
172
</div>
171
173
172
174
As a functional pseudo-class,
173
- <dfn id='heading-functional-pseudo' lt=':heading()'>:heading(<var>An+B</var> )</dfn>
175
+ <dfn id='heading-functional-pseudo' lt=':heading()'>:heading()</dfn>
174
176
notation represents elements that have a <a>heading level</a> among <var> An+B</var> .
177
+ The syntax is:
178
+
179
+ <pre class=prod>
180
+ ::heading() = ::heading( <<An+B>> # )
181
+ </pre>
182
+
183
+ The [=specificity=] of '':heading()'' is that of a class.
175
184
176
185
<div class="example">
177
186
The following example styles headings with levels between 1 and 3 with a
178
187
font-weight of 900, while headings with levels 6 onward with font-weight of
179
- 500:
188
+ 500, additionally heading levels 1 and 2 will be underlined, while 3 and
189
+ beyond will have no text-decoration:
180
190
181
191
<pre> :heading(-n+3) { font-weight: 900; }</pre>
182
192
<pre> :heading(n+6) { font-weight: 500; }</pre>
193
+ <pre> :heading(1, 2) { text-decoration: underline; }</pre>
194
+ <pre> :heading(n+3) { text-decoration: none; }</pre>
183
195
</div>
184
196
185
197
Note: The <a>heading level</a> might be different from an element's
0 commit comments