white-space-processing-015

White-space 'nowrap' and linefeed characters

WeasyPrint

This browser

Flags
ahem
Assertion
Linefeed characters are transformed into spaces, zero-width space, or not rendered when 'white-space' is set to 'nowrap'.

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 'nowrap' and linefeed characters</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#white-space-model">
 7         <meta name="flags" content="ahem">
 8         <meta name="assert" content="Linefeed characters are transformed into spaces, zero-width space, or not rendered when 'white-space' is set to 'nowrap'.">
 9         <style type="text/css">
10             span
11             {
12                 background-color: black;
13                 font-family: Ahem;
14                 white-space: nowrap;
15             }
16             #div1
17             {
18                 background: blue;
19                 display: inline-block;
20                 height: 1em;
21                 width: 5em;
22             }
23         </style>
24     </head>
25     <body>
26         <p>Test passes if there is one black box below and it is at least as long as the blue box (it can be longer).</p>
27         <div>
28             <span>XX
29 XX</span>
30         </div>
31         <div id="div1"></div>
32     </body>
33 </html>