W3C home > Mailing lists > Public > public-css-archive@w3.org > October 2020

Re: [csswg-drafts] [css-position] ‘Sticky’ behavior is too limited as position scheme created from the elements nearest block level ancestor & margins (#2496)

From: Johannes Odland via GitHub <sysbot+gh@w3.org>
Date: Fri, 16 Oct 2020 10:02:13 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-709951740-1602842532-sysbot+gh@w3.org>
Sticky positioning is great, but the current definition is limiting. 
We 'need' absolute positioned elements to be sticky all the time. 

A workaround we use is to put the element first in its containing block, position it and then use a negative margin to negate the height of the element. 

An example can be found here: https://codepen.io/johannesodland/pen/PoZrOMg

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

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 16 October 2020 10:02:15 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:20 UTC