mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 02:27:35 +00:00

There's a particularly awkward case where the static position of an abspos child of a flex container is dependent on its height. This can happen when `align-items: center` is in effect, as we have to adjust the abspos child's Y position by half of its height. This patch solves the issue by reordering operations in the abspos height resolution algorithm, to make sure that height is resolved before the static position is calculated.
18 lines
350 B
HTML
18 lines
350 B
HTML
<!DOCTYPE html><style>
|
|
* { outline: black solid 1px; }
|
|
body {
|
|
position: relative;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
.abspos {
|
|
position: absolute;
|
|
max-height: 100px;
|
|
}
|
|
.green {
|
|
display: block;
|
|
width: 100px;
|
|
height: 200px;
|
|
background: green;
|
|
}
|
|
</style><body><div class="abspos"><div class="green">
|