mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-26 09:59:43 +00:00
Applicable FCs with an indefinite width simply shrink in their available space as long as floats are intruding, but as soon as we have a definite width we must push the box down until it it has enough space again. Fixes #4136.
50 lines
1.2 KiB
HTML
50 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<style>
|
|
body {
|
|
width: 400px;
|
|
}
|
|
.a {
|
|
background: blue;
|
|
float: left;
|
|
height: 100px;
|
|
width: 100px;
|
|
}
|
|
.b {
|
|
background: green;
|
|
float: right;
|
|
height: 200px;
|
|
width: 50px;
|
|
}
|
|
.c {
|
|
background: red;
|
|
display: flex;
|
|
height: 100px;
|
|
width: 400px;
|
|
}
|
|
.d {
|
|
background: red;
|
|
display: flex;
|
|
height: 100px;
|
|
margin-left: 12.5%;
|
|
width: 300px;
|
|
}
|
|
.e {
|
|
background: red;
|
|
display: flex;
|
|
height: 100px;
|
|
margin-left: 50px;
|
|
padding-left: 10%;
|
|
width: 150px;
|
|
}
|
|
.f {
|
|
background: red;
|
|
display: flex;
|
|
margin: 0 auto;
|
|
height: 100px;
|
|
width: 200px;
|
|
}
|
|
</style><br><div class="a"></div><div class="c">This should clear the blue box.</div>
|
|
<hr><div class="a"></div><div class="b"></div><div class="c">This should clear the green box.</div>
|
|
<hr><div class="a"></div><div class="b"></div><div class="d">This should clear the blue box and sit flush against the green box.</div>
|
|
<hr><div class="a"></div><div class="e">This should sit flush against the blue box, with 40px of padding to the left.</div>
|
|
<hr><div class="a"></div><div class="b"></div><div class="f">This should be centered between the blue and green boxes.</div>
|