html-precedence-003

User style sheet precedence

WeasyPrint

This browser

Flags
userstyle
Assertion
The 'font' element's 'color' attribute trumps the user stylesheet's universal selector. They have the same specificity but the font element is a virtual author rule.

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 2 <html>
 3     <head>
 4         <title>CSS Test: User style sheet precedence</title>
 5         <link rel="author" title="Microsoft" href="http://www.microsoft.com/">
 6         <link rel="help" href="http://www.w3.org/TR/CSS21/cascade.html">
 7         <meta name="flags" content="userstyle">
 8         <meta name="assert" content="The 'font' element's 'color' attribute trumps the user stylesheet's universal selector. They have the same specificity but the font element is a virtual author rule.">
 9         <style type="text/css">
10             p
11             {
12                 color: black;
13             }
14             div
15             {
16                 color: red;
17             }
18         </style>
19     </head>
20     <body>
21         <p id="htmlPrecedence003">PREREQUISITE: The <a href="support/html-precedence-003.css">"html-precedence-003.css"</a> file is enabled as the user agent's user style sheet.</p>
22         <p>Test passes if the "Filler Text" below is green and it is underlined.</p>
23         <div>
24             <font color="green">Filler Text</font>
25         </div>
26     </body>
27 </html>