line-height-205.html (1664B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS2 Line height test: normal sizing</title> 4 <link rel="author" title="Florian Rivoal" href="https://florian.rivoal.net"> 5 <link rel="help" href="https://drafts.csswg.org/css2/visudet.html#line-height"> 6 <link rel="match" href="reference/line-height-202-ref.html"> 7 <meta name="assert" content="The height of an inline-level box whose line-height is normal and uses both the first available font and fallback fonts 8 is the same as the union of 9 baseline-aligned adjacent inline-level boxes, each using the various fonts as their primary one."> 10 <style> 11 @font-face { 12 font-family: 'high-a-only'; 13 font-style: normal; 14 font-weight: 400; 15 src: url(/fonts/Revalia.woff) format('woff'); 16 unicode-range: U+0020, U+0061; 17 } 18 @font-face { 19 font-family: 'deep-b-only'; 20 font-style: normal; 21 font-weight: 400; 22 src: url(/fonts/AD.woff) format('woff'); 23 unicode-range: U+0020, U+0062; 24 } 25 26 div { 27 position: absolute; 28 line-height: normal; 29 font-size: 100px; 30 color: transparent; 31 } 32 33 .h { font-family: high-a-only; } 34 .d { font-family: deep-b-only; } 35 .hd { font-family: high-a-only, deep-b-only; } 36 .white { background: white; } 37 .red { background: red; } 38 .shift { margin-left: 300px; } 39 </style> 40 41 <p>Test passes if there is <strong>no red</strong> below. 42 43 <!-- Check if the hd div is larger--> 44 45 <div class="hd red">ab</div> 46 <div class=white><span class=h>a</span><span class=d>b</span></div> 47 48 <!-- Same thing, reversed, to check if the hd dix is smaller --> 49 50 <div class="red shift"><span class=h>a</span><span class=d>b</span></div> 51 <div class="hd white shift">ab</div>