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-avoids-float-with-margin-004.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html>
<head>
<title>CSS Test: flow-root with specified width and margin-left should avoid right float</title>
<link rel="match" href="float-avoids-float-with-margin-004-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<meta name="assert" content="A block establishing a new BFC with a specified width whose border box positioned at its margin does not fit next to a float should be placed below it.">
<style>
.container {
width: 100px;
height: 40px;
font: 20px/1 Ahem;
}
.float {
float: right;
width: 50px;
height: 10px;
background: blue;
}
.bfc {
display: flow-root;
width: 20px;
height: 20px;
background: green;
margin-left: 40px;
}
</style>
</head>
<body>
<div class="container"><div class="float"></div><div class="bfc"></div></div>
</body>
</html>