font-041

Font shorthand set to 'inherit' inheriting four values

WeasyPrint

This browser

Flags
ahem
Assertion
The 'font' shorthand property set to 'inherit' inherits the parent element's values.

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 3     <head>
 4         <title>CSS Test: Font shorthand set to 'inherit' inheriting four values</title>
 5         <link rel="author" title="Microsoft" href="http://www.microsoft.com/">
 6         <link rel="help" href="http://www.w3.org/TR/CSS21/fonts.html#propdef-font">
 7         <link rel="help" href="http://www.w3.org/TR/CSS21/fonts.html#font-shorthand">
 8         <meta name="flags" content="ahem">
 9         <meta name="assert" content="The 'font' shorthand property set to 'inherit' inherits the parent element's values.">
10         <style type="text/css">
11             #wrapper
12             {
13                 font: italic small-caps 1in serif;
14                 position: relative;
15             }
16             #test
17             {
18                 font: 0 Ahem;
19                 font: inherit;
20                 line-height: 1em;
21                 position: absolute;
22             }
23             #reference
24             {
25                 color: red;
26                 font-family: serif;
27                 font-size: 1in;
28                 height: 1in;
29                 left: 0;
30                 line-height: 1em;
31                 position: absolute;
32                 top: 0;
33                 width: 1in;
34             }
35         </style>
36     </head>
37     <body>
38         <p>Test passes if there is no red visible on the page.</p>
39         <div id="wrapper">
40             <div id="reference">xX1</div>
41             <div id="test">xX1</div>
42         </div>
43     </body>
44 </html>