Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-text/hanging-punctuation/hanging-punctuation-allow-end-basic.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="UTF-8">
<title>CSS Text: hanging-punctuation allow-end basic overflow cases</title>
<link rel="help" href="https://drafts.csswg.org/css-text-3/#hanging-punctuation-property">
<link rel="match" href="reference/hanging-punctuation-allow-end-basic-ref.html">
<meta name="assert" content="hanging-punctuation: allow-end causes a punctuation character to hang at the end of a line only when it would otherwise cause an overflow, not when a non-punctuation character causes the overflow.">
<link rel="stylesheet" href="/fonts/ahem.css">
<style>
.hang { hanging-punctuation: allow-end; }
.not-hang { hanging-punctuation: allow-end; }
.frame { width: 65px; font-family: ahem; border: solid 3px cyan; }
</style>
<!-- Overflow occurred at U+3001. This should hang. -->
<div class="hang frame">ab c、</div>
<!-- Overflow occurred at "d". This should NOT hang. -->
<div class="not-hang frame">ab cd、</div>
<!-- Overflow occurred at first U+3001. This should NOT hang. -->
<div class="not-hang frame">ab c、、</div>
<!-- Overflow occurred at second U+3001. This should hang. -->
<div class="hang frame">a b、、</div>
<!-- Hanging with soft hyphen. This should hang. -->
<div class="hang frame">a b­c、</div>
<!-- Overflow occurred at U+3001 and there is a <br> after it. This should hang. -->
<div class="hang frame">ab c、<br></div>