Files
ladybird/Tests/LibWeb/Layout/input/block-button-margin-auto.html
Tim Ledbetter 631e73676e LibWeb: Resolve margins for block-level buttons with width:auto
Previously, buttons with `display: block` and `width: auto` would take
an early return path in compute_width() that set the content width to
fit-content but skipped all margin resolution. This meant `margin: auto`
would not center the button horizontally.
2026-01-26 10:00:17 +01:00

14 lines
202 B
HTML

<!DOCTYPE html>
<style>
.container {
width: 400px;
}
button {
margin: 0 auto;
display: block;
}
</style>
<div class="container">
<button>Test</button>
</div>