vertical-align-baseline-004

Vertical-align applied to empty 'inline-block' and baseline alignment

WeasyPrint

This browser

Flags
ahem
Assertion
The 'vertical-align' property aligns an empty 'inline-block' elements' bottom margin edge with the baseline.

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: Vertical-align applied to empty 'inline-block' and baseline alignment</title>
 5         <link rel="author" title="Microsoft" href="http://www.microsoft.com/">
 6         <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#propdef-vertical-align">
 7         <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#leading">
 8         <meta name="flags" content="ahem">
 9         <meta name="assert" content="The 'vertical-align' property aligns an empty 'inline-block' elements' bottom margin edge with the baseline.">
10         <style type="text/css">
11             div
12             {
13                 background: black;
14                 width: 3in;
15             }
16             #span1
17             {
18                 color: white;
19                 font: 1in/1em Ahem;
20             }
21             #span2
22             {
23                 background: white;
24                 display: inline-block;
25                 height: 1in;
26                 position: relative;
27                 top: 0.2em;
28                 width: 1in;
29             }
30         </style>
31     </head>
32     <body>
33         <p>Test passes if there are two parallel bars of equal width on the page.</p>
34         <div>
35             <span id="span1">X<span id="span2"></span>X</span>
36         </div>
37         <div id="reference">XXX</div>
38     </body>
39 </html>