Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<html>
<head>
<title>CSS Test: Left float with negative margin-right next to right float</title>
<link rel="match" href="float-avoids-float-with-margin-010-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<meta name="assert" content="A left float with negative margin-right has a smaller margin box and should fit next to a right float when margin box width allows it.">
<style>
.container {
width: 100px;
height: 40px;
font: 20px/1 Ahem;
}
.right {
float: right;
width: 60px;
height: 20px;
background: blue;
}
.left {
float: left;
width: 50px;
height: 20px;
background: green;
margin-right: -20px;
}
</style>
</head>
<body>
<div class="container"><div class="right"></div><div class="left"></div></div>
</body>
</html>