@@ -772,18 +772,20 @@ Cascade Order</h3>
772
772
<dt id='cascade-origin'> Origin and Importance
773
773
<dd>
774
774
The <a>origin</a> of a declaration is based on where it comes from
775
- and its <a lt="important">importance</a> is whether or not it is declared ''!important'' (see below).
775
+ and its <a lt="important">importance</a> is
776
+ whether or not it is declared with ''!important''
777
+ (see [[#importance|below]] ).
776
778
The precedence of the various <a>origins</a> is, in descending order:
777
779
778
780
<ol>
779
781
<li> Transition declarations [[!css-transitions-1]]
780
- <li> Important user agent declarations
781
- <li> Important user declarations
782
- <li> Important author declarations
782
+ <li> [= Important=] user agent declarations
783
+ <li> [= Important=] user declarations
784
+ <li> [= Important=] author declarations
783
785
<li> Animation declarations [[!css-animations-1]]
784
- <li> Normal author declarations
785
- <li> Normal user declarations
786
- <li> Normal user agent declarations
786
+ <li> [= Normal=] author declarations
787
+ <li> [= Normal=] user declarations
788
+ <li> [= Normal=] user agent declarations
787
789
</ol>
788
790
789
791
Declarations from <a>origins</a> earlier in this list win over declarations from later <a>origins</a> .
@@ -795,7 +797,7 @@ Cascade Order</h3>
795
797
such as the nested [=tree contexts=] of [=shadow trees=] in the [[!DOM]] .
796
798
When comparing two declarations
797
799
that are sourced from different [=encapsulation contexts=] ,
798
- then for normal rules
800
+ then for [= normal=] rules
799
801
the declaration from the outer context wins,
800
802
and for [=important=] rules
801
803
the declaration from the inner context wins.
@@ -809,15 +811,15 @@ Cascade Order</h3>
809
811
810
812
If the <a>scoping elements</a> of two declarations
811
813
have an ancestor/descendant relationship,
812
- then for normal rules the declaration whose <a>scoping element</a> is the descendant wins,
813
- and for important rules the declaration whose <a>scoping element</a> is the ancestor wins.
814
+ then for [= normal=] rules the declaration whose <a>scoping element</a> is the descendant wins,
815
+ and for [= important=] rules the declaration whose <a>scoping element</a> is the ancestor wins.
814
816
815
- Note: In other words, for normal declarations the inner scope's declarations override,
817
+ Note: In other words, for [= normal=] declarations the inner scope's declarations override,
816
818
but for ''!important'' rules <em> outer</em> scope's override.
817
819
818
820
For the purpose of this step,
819
821
all unscoped declarations are considered to be <a>scoped</a> to the root element.
820
- Normal declarations from style attributes
822
+ [= Normal=] declarations from style attributes
821
823
are considered to be <a>scoped</a> to the element with the attribute,
822
824
whereas important declarations from style attributes
823
825
are considered to be <a>scoped</a> to the root element.
@@ -908,31 +910,32 @@ Important Declarations: the ''!important'' annotation</h3>
908
910
CSS attempts to create a balance of power between author and user style sheets.
909
911
By default, rules in an author's style sheet override those in a user's style sheet,
910
912
which override those in the user-agent's default style sheet.
911
- To balance this, a declaration can be made <dfn export> important</dfn> ,
913
+ To balance this, a declaration can be marked [= important=] ,
912
914
which increases its weight in the cascade and inverts the order of precedence.
913
915
914
- A declaration is <a >important</a > if it has a <dfn export id='bang-important'> !important</dfn> annotation,
915
- as defined by [[css-syntax-3]] .
916
+ A declaration is <dfn export >important</dfn > if it has a '' !important'' annotation
917
+ as defined by [[css-syntax-3]] ,
916
918
i.e. if the last two (non-whitespace, non-comment) tokens
917
919
in its value are the delimiter token ''!'' followed by the identifier token ''important'' .
920
+ All other declarations are <dfn>normal</dfn> (non-[=important=] ).
918
921
919
922
<div class='example'>
920
923
<pre class='lang-css'> [hidden] { display: none !important; }</pre>
921
924
</div>
922
925
923
- An <a>important</a> declaration takes precedence over a normal declaration.
924
- Author and user style sheets may contain ''! important'' declarations,
925
- with user ''! important'' declarations overriding author ''! important'' declarations.
926
+ An <a>important</a> declaration takes precedence over a [= normal=] declaration.
927
+ Author and user style sheets may contain [= important=] declarations,
928
+ with user [= important=] declarations overriding author [= important=] declarations.
926
929
This CSS feature improves accessibility of documents by giving users with special requirements
927
930
(large fonts, color combinations, etc.)
928
931
control over presentation.
929
932
930
- Important declarations from all origins take precedence over animations.
933
+ [= Important=] declarations from all origins take precedence over animations.
931
934
This allows authors to override animated values in important cases.
932
935
(Animated values normally override all other rules.)
933
936
[[css-animations-1]]
934
937
935
- User agent style sheets may also contain ''! important'' declarations.
938
+ User agent style sheets may also contain [= important=] declarations.
936
939
These override all author and user declarations.
937
940
938
941
<div class='example'>
0 commit comments