line-break-anywhere-and-white-space-001.html (1484B)
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"> 8 <link rel="help" title="5.3. Line Breaking Strictness: the line-break property" href="https://drafts.csswg.org/css-text-3/#line-break-property"> 9 <link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-line-break-anywhere"> 10 <link rel="match" href="reference/line-break-anywhere-004-ref.html"> 11 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 12 <meta name="flags" content="Ahem"> 13 <meta name="assert" content="'line-break: anywhere' can't prevent overflow under 'white-space: pre', because it line wrapping is not allowed. "> 14 <style> 15 div { 16 position: relative; 17 font: 10px / 1 Ahem; 18 } 19 .red { 20 position: absolute; 21 background: green; 22 color: red; 23 height: 100px; 24 z-index: -1; 25 } 26 .test { 27 color: green; 28 width: 3ch; 29 line-break: anywhere; 30 31 white-space: pre; 32 } 33 </style> 34 <body> 35 <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p> 36 <div class="red">XXXX<span style="color: green">XXXX</span>XX</div> 37 <div class="test">XXXX XX</div> 38 </body>