1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:37:34 +00:00

LibWeb: Resolve grid item vertical margin/padding against CB width

Percentage vertical margin and padding values are relative to the
containing block *width*, not *height*. This has to be one of the most
commonly recurring mistakes we make :^)
This commit is contained in:
Andreas Kling 2024-01-06 18:35:31 +01:00 committed by Alexander Kalenik
parent a84778f6ee
commit cc88a2657d
3 changed files with 37 additions and 8 deletions

View file

@ -0,0 +1,19 @@
<!doctype html><style>
* {
outline: 1px solid black;
}
body {
display: grid;
width: 500px;
}
div.a {
padding-top: 25%;
margin-top: 10%;
background: pink;
}
div.b {
padding-bottom: 35%;
margin-bottom: 20%;
background: orange;
}
</style><body><div class="a"></div><div class="b"></div>