Re: [csswg-drafts] [css-position-3] New `container-fixed` value for `position` within a `@container` (#8762)

I spent 2+ hours today working around a styling quirk that this would have been an instant fix for.

I have a scrollable container, which uses a footer bar for its actions, which I want to stay stuck to the bottom. My attempts:
* With sticky positioning, the actions footer stays stuck to the bottom when there is enough height in the parent container to push it to the bottom, but otherwise it ends up floating higher up in its parent node.
  * I did also try increasing the right of the parent element to fill the area, but there were a number of reasons that didn't work related to the necessary display value and working around the different sizes of sibling elements.
* With absolute positioning, the element displays perfectly when there are no items in the parent container, but as the height of the parent container grows and it becomes scrollable, the item scrolls away with the parent's contents as the user scrolls.

In the end, the fix was to display the sticky footer in an absolutely positioned container adjacent to the scrollable container, but completely outside of it, using absolute positioning.

This also has the unintended and undesirable consequence of removing the actions footer from the context it's related to.

Ideally, I would make the scrollable element a container and use a position like `container-fixed` to give it fixed positioning regardless of scroll.

-- 
GitHub Notification of comment by brandonmcconnell
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8762#issuecomment-3238036869 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 29 August 2025 19:34:46 UTC