mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:17:35 +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,13 @@
|
|||
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
||||
BlockContainer <html> at (0,0) content-size 800x466 [BFC] children: not-inline
|
||||
Box <body> at (8,8) content-size 500x450 [GFC] children: not-inline
|
||||
BlockContainer <div.a> at (8,183) content-size 500x0 [BFC] children: not-inline
|
||||
BlockContainer <div.b> at (8,183) content-size 500x0 [BFC] children: not-inline
|
||||
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
|
||||
TextNode <#text>
|
||||
|
||||
ViewportPaintable (Viewport<#document>) [0,0 800x600]
|
||||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x466]
|
||||
PaintableBox (Box<BODY>) [8,8 500x450]
|
||||
PaintableWithLines (BlockContainer<DIV>.a) [8,58 500x125]
|
||||
PaintableWithLines (BlockContainer<DIV>.b) [8,183 500x175]
|
|
@ -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