3. Sort declarations with the same level of importance and origin by selector
specificity.
4. Finally, if declarations have the same level of importance, origin, and specificity,
sort them by the order in which they??™re specified; the last declaration wins.
In step one, a user agent finds all the valid declarations for the specific property to
be applied to the element in question; to do so, it looks at all the sources that specify
CSS styles for the given media type. Declarations can come from three sources: the
user agent, the author, and user style sheets.
User agent style sheets are the default sets of declarations applied by the user agent.
For example, according to the CSS specification,1 the default value for the
text-decoration (p. 332) property is none, but typically, user agents set this property
to underline for a elements. In some user agents, the default settings can be changed;
1 http://www.w3.org/TR/CSS21/text.html#decoration
119 The Cascade, Specificity, and Inheritance
for example, a user might be able to change the default background color, which
may change the user agent style sheet.
Pages:
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182