1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 23:08:11 +00:00
serenity/Tests/LibWeb/Layout/input/block-and-inline/narrow-bfc-width-to-avoid-overlap-with-floats.html
Aliaksandr Kalenik 853ecb8d8e LibWeb: Narrow width of boxes that create BFC to avoid overlap of float
https://www.w3.org/TR/CSS22/visuren.html#floats says that when a box
establishes BFC it should not overlap with floats. The way to avoid
overlaps is up to implementor. This change implements avoiding overlap
by narrowing width of a box because it seems like what other engines
do (in the scenarios I tested).
2023-05-04 06:14:58 +02:00

23 lines
650 B
HTML

<style>
* {
font-family: 'SerenitySans';
}
.float {
width: 200px;
height: 1000px;
background-color: royalblue;
float: right;
}
.bfc {
background-color: mediumseagreen;
border: 10px solid skyblue;
display: flow-root;
}
</style>
<div class="wrapper"><div class="float"></div><div class="bfc">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque vitae
neque nunc. Nam fermentum libero a lectus vulputate eleifend. Nam sagittis
tristique augue, id sodales mauris suscipit at. Vivamus eget placerat ex.
Suspendisse potenti. Morbi pulvinar ipsum eget nulla dapibus, ac varius mi
eleifend.