hyphens-auto-002.html (1365B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Text: 'hyphens: auto' with a valid 'lang' attribute specification</title> 4 <link rel="author" title="Javier Fernandez" href="mailto:jfernandez@igalia.com" /> 5 <link rel="help" title="5.4. Hyphenation: the hyphens property" href="https://drafts.csswg.org/css-text-3/#hyphenation"> 6 <link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-hyphens-auto"> 7 <link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-pre-wrap"> 8 <link rel="match" href="reference/hyphens-auto-002-ref.html"> 9 <meta name="flags" content="ahem"> 10 <meta name="assert" content="Although hyphenation is enabled, honoring 'auto' value for the 'hyphens' CSS property and a valid 'lang' attribute, the words fit. However, we should break preserved white spaces, honoring 'white-space: pre-wrap' to prevent overflow."> 11 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 12 <style> 13 .fail { 14 position: absolute; 15 background: red; 16 width: 100px; 17 height: 100px; 18 z-index: -1; 19 } 20 .test { 21 font: 50px/1 Ahem; 22 width: 6ch; 23 color: green; 24 25 white-space: pre-wrap; 26 hyphens: auto; 27 } 28 </style> 29 <body lang="en"> 30 <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p> 31 <div class="fail"></div> 32 <div class="test">XX XX</div> 33 </body>