Re: specifying position:sticky

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).

Corey

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