first-line-pseudo-012

vertical-align: length on :first-line

WeasyPrint

This browser

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html lang="en">
 3  <head>
 4   <title>CSS Test: vertical-align: length on :first-line</title>
 5   <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch">
 6   <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/block/first-line/012.html" type="text/html">
 7   <link rel="help" href="http://www.w3.org/TR/CSS21/selector.html#first-line-pseudo">
 8   <style type="text/css">
 9   .ahem { display: inline; font: 1em/1 Ahem, sans-serif; background: red; color: white; }
10   .container { font-size: 3em; }
11   .test, .control, .reference { border: solid black; width: 1em; }
12   .test, .control { font: 1em/1 Ahem; color: aqua; background: yellow; }
13   .a { background: fuchsia; }
14   .test:first-line, .control .first-line { vertical-align: 0.8em; }
15   .reference .ra { height: 0.8em; background: aqua; }
16   .reference .rb { height: 0.2em; background: fuchsia; }
17   .reference .rc { height: 0.8em; background: yellow; }
18   .reference .rd { height: 1.0em; background: aqua; }
19   </style>
20  </head>
21  <body>
22   <div class="ahem">Ahem_font_required_for_this_test.</div>
23   <p>The next three boxes should be pixel-perfect identical.</p>
24   <div class="container">
25    <p class="test">
26     <span class="a">&Eacute;</span>
27     <span class="b">X</span>
28    </p>
29    <p class="control">
30     <span class="first-line"><span class="a">&Eacute;</span></span>
31     <span class="b">X</span>
32    </p>
33    <div class="reference">
34     <div class="ra"></div>
35     <div class="rb"></div>
36     <div class="rc"></div>
37     <div class="rd"></div>
38    </div>
39   </div>
40  </body>
41 </html>