line-break-anywhere-and-white-space-006.html (1636B)
1 <!DOCTYPE html> 2 <html lang=en> 3 <meta charset="utf-8"> 4 <title>CSS Text Test: line-break: anywhere and the white-space property</title> 5 <link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com"> 6 <link rel="help" title="3. White Space and Wrapping: the white-space property" href="https://drafts.csswg.org/css-text-3/#white-space-property"> 7 <link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-pre-wrap"> 8 <link rel="help" title="4.1.3. Phase II: Trimming and Positioning" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2"> 9 <link rel="help" title="5.3. Line Breaking Strictness: the line-break property" href="https://drafts.csswg.org/css-text-3/#line-break-property"> 10 <link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-line-break-anywhere"> 11 <link rel="match" href="reference/line-break-anywhere-004-ref.html"> 12 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 13 <meta name="flags" content="Ahem"> 14 <meta name="assert" content="'line-break: anywhere' can't break a preserved sequence of spaces under 'white-spate: pre-wrap', which should hang instead."> 15 <style> 16 div { 17 position: relative; 18 font: 25px / 1 Ahem; 19 } 20 .red { 21 position: absolute; 22 background: green; 23 color: red; 24 height: 100px; 25 z-index: -1; 26 } 27 .test { 28 color: green; 29 width: 2ch; 30 31 line-break: anywhere; 32 white-space: pre-wrap; 33 } 34 </style> 35 <body> 36 <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p> 37 <div class="red">XXXX<br>XX</div> 38 <div class="test">X<span style="background: green"> </span>XX</div> 39 </body>