white-space-003.xht (1930B)
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: White-space set to 'nowrap'</title> 5 <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> 6 <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#propdef-white-space" /> 7 <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#white-space-prop" /> 8 <link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-1" /> 9 <link rel="match" href="white-space-001-ref.xht" /> 10 <meta name="flags" content="ahem" /> 11 <meta name="assert" content="The 'white-space' property set to 'nowrap' removes extra spacing when more than one space is next to another. And the text does not wrap when width is constrained." /> 12 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 13 <style type="text/css"> 14 div 15 { 16 font: 1em Ahem; 17 line-height: 1em; 18 } 19 #test 20 { 21 white-space: nowrap; 22 width: 1em; 23 } 24 #reference 25 { 26 height: 1em; 27 width: 5em; 28 } 29 #div1, #div3 30 { 31 background: black; 32 } 33 #div1, #div2, #div3 34 { 35 display: inline-block; 36 height: 1em; 37 width: 2em; 38 } 39 #div2 40 { 41 height: 1em; 42 width: 1em; 43 } 44 </style> 45 </head> 46 <body> 47 <p>Test passes if there are 2 filled black squares.</p> 48 <div id="test">XX XX</div> 49 <div id="reference"><div id="div1"></div><div id="div2"></div><div id="div3"></div></div> 50 </body> 51 </html>