Files
rust_browser/tests/goldens/fixtures/186-negative-margin-auto-height.html
Zachary D. Rowitsch 90063566d4 Clamp auto-height to zero when negative margins produce negative content height
CSS 2.1 §10.6.3 defines auto-height as the distance from the content top
to the last in-flow child's margin-box bottom. Large negative margins can
make this negative, which has no geometric meaning. Clamp to 0 to match
browser behavior and fix Acid2 .empty div layout.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 04:37:25 -05:00

22 lines
278 B
HTML

<!DOCTYPE html>
<html>
<head>
<style>
.parent {
width: 200px;
background: red;
}
.child {
height: 50px;
margin-bottom: -100px;
background: green;
}
</style>
</head>
<body>
<div class="parent">
<div class="child"></div>
</div>
</body>
</html>