mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:27:45 +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:
parent
a84778f6ee
commit
cc88a2657d
3 changed files with 37 additions and 8 deletions
|
@ -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>
|
Loading…
Add table
Add a link
Reference in a new issue