Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/CSS2/floats/float-after-block-with-collapsed-margin-inside-inline.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>CSS Test: A float after a block which collapses its top margin with its grandparent, where the parent is an inline box</title>
<link rel="author" href="mailto:obrufau@igalia.com" title="Oriol Brufau">
<link rel="match" href="../../reference/ref-filled-green-200px-square.html">
<style>
span > div {
width: 200px;
height: 100px;
background: green;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div style="overflow: hidden">
<!-- This is just to avoid collapsing margins with the <p>. -->
</div>
<div style="width: 200px; height: 200px; margin-top: -100px; background: red">
<span>
<div style="margin-top: 100px"></div>
<div style="float: left"></div>
</span>
</div>