mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02:00
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.
14 lines
202 B
HTML
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>
|