W3C home > Mailing lists > Public > www-style@w3.org > July 2013

Re: specifying position:sticky

From: Corey Ford <cford@mozilla.com>
Date: Sat, 13 Jul 2013 13:13:48 -0700
Message-ID: <51E1B4FC.8060003@mozilla.com>
To: Zack Weinberg <zackw@panix.com>
CC: www-style list <www-style@w3.org>
On 7/13/13 1:01 PM, Zack Weinberg wrote:
> On a less grouchy note, what happens if you have
> <style> h2 { position: sticky } </style>
> <div>
>    <h2>Thing One</h2>
>    <p>... text here ... </p>
>    <h2>Thing Two</h2>
>    <p>... more text here ...</p>
> </div>
> and the container is scrolled such that, if not for position:sticky,
> the second <h2> would be occupying the screen position occupied by the
> first <h2>?  IIRC Webkit has the second <h2> displace the first one,
> and that seems sensible to me.

WebKit's implementation (and, as best I gathered, the general consensus 
from last summer's discussion) has the elements simply overlap. It's 
more straightforward to specify/understand/implement, and the 
displacement behavior can still be achieved by putting the two elements 
inside sibling containing blocks (such as one for each section).

Received on Saturday, 13 July 2013 20:14:18 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:32 UTC