overflow-wrap-break-word-009.html (1225B)
1 <!DOCTYPE html> 2 <html lang=en> 3 <meta charset="utf-8"> 4 <title>CSS Text Test: overflow-wrap: break-word</title> 5 <link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com"> 6 <link rel="help" title="5.5. Overflow Wrapping: the overflow-wrap/word-wrap property" href="https://drafts.csswg.org/css-text-3/#overflow-wrap-property"> 7 <link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-overflow-wrap-break-word"> 8 <link rel="match" href="reference/overflow-wrap-break-word-001-ref.html"> 9 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 10 <meta name="flags" content="Ahem"> 11 <meta name="assert" content="The text is wrapped into two lines, since there is no need to break the second line using the space in the middle."> 12 <style> 13 div { 14 position: relative; 15 font: 25px / 1 Ahem; 16 } 17 .ref { 18 position: absolute; 19 background: green; 20 color: red; 21 width: 100px; 22 height: 100px; 23 z-index: -1; 24 } 25 .test { 26 color: green; 27 width: 3ch; 28 29 overflow-wrap: break-word; 30 } 31 </style> 32 <body> 33 <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p> 34 <div class="ref">XXX<br>X X</div> 35 <div class="test">XXXX<span> </span>X</div> 36 </body>