content-white-space-002

Content property and white-space: pre

WeasyPrint

This browser

Assertion
'white-space: pre' 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: pre</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: pre' applies to generated string content.">
10         <style type="text/css">
11             div {
12                 border: solid silver;
13                 margin: 0.5em;
14                 padding: 0.2em;
15                 color: blue;
16             }
17             #reference
18             {
19                 white-space: pre;
20             }
21             #test:before
22             {
23                 content: "This text\A		should be on\A     	four\A         lines.";
24                 white-space: pre;
25             }
26         </style>
27     </head>
28     <body>
29         <p>Test passes if the contents of the two silver boxes are identical.</p>
30         <div id="reference">This text
31 	should be on
32     	four
33         lines.</div>
34         <div id="test"></div>
35     </body>
36 </html>