content-white-space-003

Content property and white-space: nowrap

WeasyPrint

This browser

Assertion
'white-space: nowrap' applies to generated string content.

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: Content property and white-space: nowrap</title>
 5         <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
 6         <link rel="author" title="Microsoft" href="http://www.microsoft.com/">
 7         <link rel="help" href="http://www.w3.org/TR/CSS21/generate.html#content">
 8         <meta name="flags" content="">
 9         <meta name="assert" content="'white-space: nowrap' applies to generated string content.">
10         <style type="text/css">
11             div.outer {
12                 border: solid silver;
13                 margin: 0.5em;
14                 padding: 0.2em;
15                 color: blue;
16             }
17             div div {
18                 width: 4em;
19             }
20             #reference
21             {
22                 white-space: nowrap;
23             }
24             #test:before
25             {
26                 content: "This text\A		should be on\A     	one\A         line.";
27                 white-space: nowrap;
28             }
29         </style>
30     </head>
31     <body>
32         <p>Test passes if the contents of the two silver boxes are identical.</p>
33         <div class="outer"> <div id="reference">This text should be on one line.</div></div>
34         <div class="outer"><div id="test"></div></div>
35     </body>
36 </html>