Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<meta charset="utf-8">
<title>wrap-inside: avoid suppresses line-break: anywhere opportunities inside the box</title>
<link rel="match" href="wrap-inside-avoid-line-break-anywhere-ref.html">
<meta name="assert" content="'line-break: anywhere' adds a soft wrap opportunity around every character within the box, but 'wrap-inside: avoid' suppresses them: the line breaks before the box rather than mid-word, when there is a break opportunity outside the box.">
<link rel="stylesheet" href="/fonts/ahem.css">
<style>
div { width: 90px; font: 20px/20px Ahem; color: green; }
</style>
<!--
"XX YYYY" (140px) overflows 90px. 'line-break: anywhere' would otherwise break inside the box mid-word as "XX Y" / "YYY".
'wrap-inside: avoid' instead breaks at the space outside the box: "XX" / "YYYY".
-->
<div>XX <span style="wrap-inside: avoid; line-break: anywhere">YYYY</span></div>