Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<html>
<head>
<title>CSS Test: flow-root with margin-left between two floats</title>
<link rel="match" href="float-avoids-float-with-margin-012-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<meta name="assert" content="A BFC with a specified width and margin-left that fits between a left float and a right float should remain on the same line. The start-side float absorbs part of the margin.">
<style>
.container {
width: 100px;
height: 40px;
font: 20px/1 Ahem;
}
.left {
float: left;
width: 20px;
height: 20px;
background: blue;
}
.right {
float: right;
width: 20px;
height: 20px;
background: blue;
}
.bfc {
display: flow-root;
width: 30px;
height: 20px;
background: green;
margin-left: 40px;
}
</style>
</head>
<body>
<div class="container"><div class="left"></div><div class="right"></div><div class="bfc"></div></div>
</body>
</html>