tab-min-rendered-width-1.html (1238B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>CSS Text Test: minimum rendered width of tab character</title> 5 <link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com"> 6 <link rel="reviewer" title="Xidorn Quan" href="https://www.upsuper.org/"> 7 <link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2"> 8 <link rel="match" href="tab-min-rendered-width-1-ref.html"> 9 <meta name="assert" content="If [rendered width of tab would be] less than 0.5ch, then the subsequent tab stop is used instead."> 10 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> 11 <style> 12 span { background-color: yellow; display: inline-block; } 13 /* Using 16px Ahem means that the 'ch' unit will be evenly divisible by 8 (for the 0.125ch 14 increment used below) without running into floating-point accuracy limitations */ 15 pre { position: absolute; top: 0; font: 16px Ahem; } 16 tt { font: 16px monospace; } 17 </style> 18 </head> 19 <body> 20 <pre> 21 </pre> 22 <script> 23 let pre = document.getElementsByTagName("pre")[0]; 24 let test = ""; 25 for (i = 7.0; i <= 8.125; i += 0.125) { 26 test += `<span style="width:${i}ch"><tt>${i}ch</tt></span>	<tt>foo</tt>\n`; 27 } 28 pre.innerHTML = test; 29 </script> 30 </body> 31 </html>