word-spacing-characters-001

word-spacing on Flexible Space Characters

WeasyPrint

This browser

Assertion
Word-spacing affects each space (U+0020) and non-breaking space (U+00A0).

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: word-spacing on Flexible Space Characters</title>
 5   <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
 6   <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#spacing-props">
 7   <meta name="flags" content="">
 8   <meta name="assert" content="Word-spacing affects each space (U+0020)         and non-breaking space (U+00A0).">
 9   <style type="text/css">
10     div {
11       margin: 1em;
12       font-family: monospace;
13       page-break-inside: avoid;
14     }
15     div p {
16       margin: 0;
17     }
18     .controlcontrol {
19       background: orange;
20       width: 4em;
21     }
22 
23     .control span {
24       background: blue;
25       color: blue;
26     }
27     .spacer {
28       padding-left: 4em;
29     }
30     .test span {
31       word-spacing: 4em;
32       background: orange;
33       color: orange;
34     }
35     .ws-pre p {
36       white-space: pre;
37     }
38   </style>
39  </head>
40  <body>
41    <p>In each of the following pairs, the blue and orange bars must have equal lengths.</p>
42 
43     <div>
44       <p class="control"><span class="spacer"></span>&nbsp;</p>
45       <p class="controlcontrol">&nbsp;</p>
46     </div>
47 
48    <div class="ws-normal">
49      <p class="control"><span>A <span class="spacer"></span>B</span></p>
50      <p class="test"><span>A B</span></p>
51    </div>
52    <div class="ws-normal">
53      <p class="control"><span>A <span class="spacer"></span>B</span></p>
54      <p class="test"><span>A  B</span></p>
55    </div>
56    <div class="ws-pre">
57      <p class="control"><span>A <span class="spacer"></span> <span class="spacer"></span>B</span></p>
58      <p class="test"><span>A  B</span></p>
59    </div>
60 
61    <div class="ws-normal">
62      <p class="control"><span>A&nbsp;<span class="spacer"></span>B</span></p>
63      <p class="test"><span>A&nbsp;B</span></p>
64    </div>
65    <div class="ws-normal">
66      <p class="control"><span>A&nbsp;&nbsp;<span class="spacer"></span><span class="spacer"></span>B</span></p>
67      <p class="test"><span>A&nbsp;&nbsp;B</span></p>
68    </div>
69    <div class="ws-pre">
70      <p class="control"><span>A&nbsp;&nbsp;<span class="spacer"></span><span class="spacer"></span>B</span></p>
71      <p class="test"><span>A&nbsp;&nbsp;B</span></p>
72    </div>
73 
74    <div class="ws-normal">
75      <p class="control"><span>A&nbsp; &nbsp; <span class="spacer"></span><span class="spacer"></span><span class="spacer"></span><span class="spacer"></span>B</span></p>
76      <p class="test"><span>A&nbsp;  &nbsp;    	
77  	 B</span></p>
78    </div>
79    <div class="ws-pre">
80      <p class="control"><span>A&nbsp;  &nbsp;  <span class="spacer"></span><span class="spacer"></span><span class="spacer"></span><span class="spacer"></span><span class="spacer"></span><span class="spacer"></span>	B</span></p>
81      <p class="test"><span>A&nbsp;  &nbsp;  	B</span></p>
82    </div>
83 
84  </body>
85 </html>