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/wrap-inside/wrap-inside-avoid-block-child.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>wrap-inside: avoid does not propagate into a block-level child</title>
<link rel="match" href="wrap-inside-avoid-block-child-ref.html">
<meta name="assert" content="The 'avoid' effect of an inline box does not propagate across a formatting context boundary: a block-level child does not inherit the effective avoid, so its own content wraps normally and only its explicit inner avoid box is kept together.">
<link rel="stylesheet" href="/fonts/ahem.css">
<style>
div { width: 110px; font: 20px/20px Ahem; color: green; }
</style>
<!--
Inside the block, "WW XX" (100px) fits within 110px. If the outer avoid propagated into the block, "WW" would
also be avoid and the whole thing would break inside as a last resort: "WW XX" / "YY". Since avoid does not cross
the block boundary, "WW" is a normal wrap opportunity and only the inner "XX YY" box is kept together, so the line
breaks before it: "WW" / "XX YY".
-->
<div><span style="wrap-inside: avoid"><div>WW <span style="wrap-inside: avoid">XX YY</span></div></span></div>