Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text Decoration 4: text-decoration-trim</title>
<link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com">
<style>
body {
background: white;
color: black;
}
div {
position: relative;
}
h1 {
position: absolute;
}
u {
text-decoration-color: black;
}
</style>
<p>The underline for "ultra-quick brown" should be trimmed by .25em at each end;
super- and sub-scripts should be unaffected:</p>
<div>
<h1>
the u<u>ltra-<sup>quick</sup> b<sub>ro</sub>w</u>n fox
</h1>
<h1 style="left: .25em; color: transparent">
the <u>ultra</u>-<sup>quick</sup> b<sub>ro</sub>wn fox
</h1>
<h1 style="left: -.25em; color: transparent">
the ultra-<sup>quick</sup> b<sub>ro</sub>w<u>n</u> fox
</h1>
</div>