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
document. A user agent's default style sheet should present the
251
247
elements of the document language in ways that satisfy general
252
248
presentation expectations for the document language (e.g., for visual
253
-
browsers, the EM element in HTML is presented using an italic
254
-
font). See <a href="sample.html">"A sample style sheet for HTML
255
-
4.0"</a> for a recommended default style sheet for HTML 4.0 documents.
249
+
browsers, the "em" element in HTML is presented using an italic
250
+
font). See <a href="sample.html">A sample style sheet for HTML
251
+
</a> for a recommended default style sheet for HTML documents.
256
252
257
253
<P>Note that the default style sheet may change if system settings are
258
254
modified by the user (e.g., system colors). However, due to
@@ -290,9 +286,7 @@ must apply the following sorting order:</p>
290
286
Declarations apply if the associated selector <A
291
287
HREF="selector.html">matches</A> the element in question.
292
288
293
-
<!-- HWL 20020423: editorial change to description of weight/origin -->
294
-
295
-
<LI>The primary sort of the declarations is by weight (normal or important) and origin (author, user, or user agent). The weight of style sheets, in ascending order, is:
289
+
<LI>The primary sorting criteria for declarations is weight (normal or important) and origin (author, user, or user agent). The weight of style sheets, in ascending order, is:
296
290
297
291
<ol>
298
292
<li>user agent style sheets
@@ -303,7 +297,7 @@ must apply the following sorting order:</p>
303
297
</ol>
304
298
305
299
<LI>
306
-
The secondary sort is by <a href="#specificity">specificity</a>
300
+
The secondary sorting criteria is <a href="#specificity">specificity</a>
307
301
of selector: more specific
308
302
selectors will override more general ones. Pseudo-elements and
309
303
pseudo-classes are counted as normal elements and classes,
@@ -354,7 +348,7 @@ equivalent to declaring all of its sub-properties to be "!important".
354
348
355
349
<div class="example">
356
350
357
-
<P>The first rule in the user's style sheet in the following example
351
+
<P>The first rule in the user's style sheet in the following example
358
352
contains an "!important" declaration, which overrides the corresponding
359
353
declaration in the author's style sheet. The second declaration
360
354
will also win due to being marked "!important". However, the third
@@ -367,14 +361,14 @@ function also within author style sheets.
367
361
368
362
<PRE>
369
363
/* From the user's style sheet */
370
-
P { text-indent: 1em ! important }
371
-
P { font-style: italic ! important }
372
-
P { font-size: 18pt }
364
+
p { text-indent: 1em ! important }
365
+
p { font-style: italic ! important }
366
+
p { font-size: 18pt }
373
367
374
368
/* From the author's style sheet */
375
-
P { text-indent: 1.5em !important }
376
-
P { font: 12pt sans-serif !important }
377
-
P { font-size: 24pt }
369
+
p { text-indent: 1.5em !important }
370
+
p { font: 12pt sans-serif !important }
371
+
p { font-size: 24pt }
378
372
</PRE>
379
373
</div>
380
374
@@ -383,14 +377,19 @@ P { font-size: 24pt }
383
377
<P>A selector's specificity is calculated as follows:</p>
384
378
385
379
<ul>
380
+
386
381
<li>count 1 if the selector is a 'style' attribute rather than a
387
382
selector, 0 otherwise (= a) (In HTML, values of an element's "style"
388
383
attribute are style sheet rules. These rules have no selectors, so
389
384
a=1, b=0, c=0, and d=0.)
385
+
390
386
<li>count the number of ID attributes in the selector (= b)
387
+
391
388
<li>count the number of other attributes and pseudo-classes
392
389
in the selector (= c)
390
+
393
391
<li>count the number of element names in the selector (= d)
0 commit comments