wpt / css / css-text / hanging-punctuation / hanging-punctuation-variable-font-size.html

Status: PASS | Duration: 8ms | Subtests: 1/1 | Open test on wpt.live | Open ref on wpt.live | wpt.fyi

/css/css-text/hanging-punctuation/hanging-punctuation-variable-font-size.html

<!DOCTYPE html>
<meta charset="UTF-8">
<title>CSS Text: hanging-punctuation first last with variable font size</title>
<link rel="help" href="https://drafts.csswg.org/css-text-3/#hanging-punctuation-property">
<link rel="match" href="reference/hanging-punctuation-variable-font-size-ref.html">
<meta name="assert" content="hanging-punctuation: first last hangs punctuation by the width of the punctuation character itself, even when the punctuation has a different font size than the surrounding text.">
<link rel="stylesheet" href="/fonts/ahem.css">
<style>
    body { font-family: 'Ahem'; color:green }
    .hang { hanging-punctuation: first last; margin:1em; float:left }
</style>
<div class="hang" style="font-size:32px"><span style="font-size:16px">(</span>1234</div>

<div class="hang" style="font-size:32px">1234<span style="font-size:16px">)</span></div>

/css/css-text/hanging-punctuation/reference/hanging-punctuation-variable-font-size-ref.html

<!DOCTYPE html>
<meta charset="UTF-8">
<title>CSS Reference</title>
<link rel="stylesheet" href="/fonts/ahem.css">
<style>
    body { font-family: 'Ahem'; color:green }
    .hang { white-space: nowrap; margin:1em; float:left }
</style>
<div class="hang" style="font-size:32px"><span style="font-size:16px; margin-left:-1em">(</span>1234</div>

<div class="hang" style="font-size:32px">1234<span style="font-size:16px; margin-right:-1em">)</span></div>