white-space-003

White-space set to 'nowrap'

WeasyPrint

This browser

Flags
ahem
Assertion
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.

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: 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         <meta name="flags" content="ahem">
 9         <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.">
10         <style type="text/css">
11             div
12             {
13                 font: 1em Ahem;
14                 line-height: 1em;
15             }
16             #test
17             {
18                 white-space: nowrap;
19                 width: 1em;
20             }
21             #reference
22             {
23                 height: 1em;
24                 width: 5em;
25             }
26             #div1, #div3
27             {
28                 background: black;
29             }
30             #div1, #div2, #div3
31             {
32                 display: inline-block;
33                 height: 1em;
34                 width: 2em;
35             }
36             #div2
37             {
38                 height: 1em;
39                 width: 1em;
40             }
41         </style>
42     </head>
43     <body>
44         <p>Test passes if there are two black squares on the page.</p>
45         <div id="test">XX   XX</div>
46         <div id="reference"><div id="div1"></div><div id="div2"></div><div id="div3"></div></div>
47     </body>
48 </html>