Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<title>CSS Test: A float in a block-level box inside an inline box paints over an earlier float</title>
<link rel="match" href="float-in-block-inside-inline-paint-order-ref.html">
<meta name="assert" content="Floats paint in tree order, so the green float, which is in a block-level box inside an inline box, paints over the earlier red float.">
<style>
#container {
width: 200px;
}
#red-first-float {
float: left;
width: 100px;
height: 100px;
background-color: red;
}
#block {
height: 100px;
}
#green-second-float {
float: left;
width: 150px;
height: 100px;
margin-left: -100px;
background-color: green;
}
</style>
<div id="container"><span><div id="red-first-float"></div><div id="block"><div id="green-second-float"></div></div></span></div>