overflow-wrap-break-word-007.html (1262B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Text Test: overflow-wrap: break-word</title> 4 <link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com"> 5 <link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-overflow-wrap-break-word"> 6 <link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-pre-wrap"> 7 <meta name="flags" content="ahem"> 8 <link rel="match" href="reference/overflow-wrap-break-word-001-ref.html"> 9 <meta name="assert" content="A Single leading white-space constitutes a soft breaking opportunity, honoring the 'white-space: pre-wrap' property, that must prevent the word to be broken."> 10 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 11 <style> 12 div { 13 position: relative; 14 font-size: 20px; 15 font-family: Ahem; 16 line-height: 1em; 17 } 18 .red { 19 position: absolute; 20 background: green; 21 color: red; 22 width: 100px; 23 height: 100px; 24 z-index: -1; 25 white-space: pre; 26 } 27 .test { 28 color: green; 29 width: 5ch; 30 31 white-space: pre-wrap; 32 overflow-wrap: break-word; 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"> XX <br>XXX</div> 38 <div class="test"> XX XXX </div> 39 </body>