Contain and scrollports
I'm completely baffled by the third container's behavior. Both of these rules apparently create a Block Formatting Context, and yet they work differently.
Looking at the MDN page for contain, setting the rule to paint or layout cuts off the overflowing content, since
position: fixed;
doesn't contribute to the height of the parent. Adding overflow: scroll;
then adds the height of the child to the height of the parent for the height of the scrollport, but leaves the height of the parent as just the parent's non-fixed contents. However, without the contain: layout;
, the child doesn't contribute to the scrollport, and jumps out of the scrollport without contributing to it.
It definitely feels like there should be a way for the two rules to coexist, such that the child is outside the scrollport and doesn't contribute to it while allowing the parent to have its own scrollable content. Does anyone know how that may be possible?1 Reply
Following as I’m very unsure on how to work with the contain property and its values