inlines-016

Inline box model: space collapsing, padding, white-space, et al

WeasyPrint

This browser

Flags
ahem
Assertion
If a space (U+0020) at the beginning of a line has 'white-space' set to 'normal', then it is removed, even if there's padding.

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html lang="en">
 3  <head>
 4   <title>CSS Test: Inline box model: space collapsing, padding, white-space, et al</title>
 5   <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch">
 6   <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/inline/016.html" type="text/html">
 7   <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#white-space-model">
 8   <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#inline-boxes">
 9   <meta name="flags" content="ahem">
10   <meta name="assert" content="If a space (U+0020) at the beginning of a line     has 'white-space' set to 'normal', then it is removed, even if there's padding.">
11   <style type="text/css">
12    .ahem { display: inline; font: 900 1em/1 Ahem, sans-serif; background: red; color: white; }   
13    div { width: 4em; background: teal; color: aqua; margin: 1em; font: 2em/1 Ahem; }
14    .test span { padding-left: 1em; }
15    .control { white-space: pre; }
16   </style>
17  </head>
18  <body>
19   <p>The following two blocks should be identical.</p>
20   <div class="test"><span> XX</span></div>
21   <div class="control"><span> XX</span></div>
22  </body>
23 </html>