Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/CSS2/box/negative-margin-inline-005.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>Negative inline margins allow the ends of the inline to project</title>
<link rel="match" href="negative-margin-inline-005-ref.html">
<style>
.outer {
display: inline-block;
font: 16px monospace;
border:1px solid gray;
margin: 2em;
}
.a {
width: min-content;
}
.b {
width: fit-content;
}
.c {
width: 8ch;
}
.d {
width: 21ch;
}
.inner {
margin-inline: -1ch;
}
u {
margin-inline: -1ch;
color: blue;
}
</style>
<p>The <u>blue spans</u> have -1ch inline-margin, so their ends may project at line-breaks,
as does the text as a whole:</p>
<span class="outer a"><span class="inner">The <u>very quick brown fox</u> jumps over the <u>lazy dog</u> slowly.</span></span>
<span class="outer b"><span class="inner">The <u>very quick brown fox</u> jumps over the <u>lazy dog</u> slowly.</span></span>
<span class="outer c"><span class="inner">The <u>very quick brown fox</u> jumps over the <u>lazy dog</u> slowly.</span></span>
<span class="outer d"><span class="inner">The <u>very quick brown fox</u> jumps over the <u>lazy dog</u> slowly.</span></span>