diff --git a/crates/core/src/document/html/engine.rs b/crates/core/src/document/html/engine.rs
index 6f76a1e..89895d3 100644
--- a/crates/core/src/document/html/engine.rs
+++ b/crates/core/src/document/html/engine.rs
@@ -516,7 +516,7 @@ impl Engine {
}
// Collapse top and bottom margins of empty blocks.
- if rects.is_empty() {
+ if rects.is_empty() || rects == [None] {
style.margin.bottom = collapse_margins(style.margin.bottom, style.margin.top);
style.margin.top = 0;
}