Post #1756590
2026-04-12 15:21 UTC
@css Basically, what I just showed.
p img {
max- width: 100%-of-content-after-floats;
}
On my blog pages: https://www.quirksmode.org/quirksblog/2026/0410-bugreport.html
The p's content is influenced by the float. Ideally, the image should just stretch the p's content width.
Replies (1)
-
@css@front-end.social 2026-04-12 15:36
@ppk Your floater element has a fixed width, you have a fixed margin-left for the p element and they have a max-width so you can do the following calculation: max-width: min(680px,100cqw - 332px - 380px) and you set container-type: inline-size to HTML to get the 100cqw and then you adjust when the layout change with the media queries