line-height-067.xht (2017B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title>CSS Test: Line-height using 'em' units with a minimum minus one value, -1em</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-line-height" /> 7 <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#leading" /> 8 <meta name="flags" content="ahem invalid should" /> 9 <meta name="assert" content="The 'line-height' property sets a minimum minus one length value in 'em' units." /> 10 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 11 <style type="text/css"> 12 div 13 { 14 font: 1in Ahem; 15 position: relative; 16 width: 1em; 17 } 18 #div2, #div3, #div4 19 { 20 position: absolute; 21 top: 0; 22 } 23 #div2, #div4 24 { 25 background: black; 26 } 27 #div2 28 { 29 height: 1.2em; 30 left: 0; 31 } 32 #div3 33 { 34 background: blue; 35 color: blue; 36 left: 1em; 37 line-height: -1em; 38 } 39 #div4 40 { 41 height: 1em; 42 left: 2em; 43 } 44 </style> 45 </head> 46 <body> 47 <p>Test passes if the height of the blue box is similar to the height of the black boxes. It is acceptable to have the blue box height be shorter or taller than the height of either of the black boxes. The black boxes represent the recommended settings for 'line-height'.</p> 48 <div id="div1"> 49 <div id="div2"></div> 50 <div id="div3">X</div> 51 <div id="div4"></div> 52 </div> 53 </body> 54 </html>