Re: specifying position:sticky

On 7/13/13 7:52 AM, Brad Kemper wrote:
> Given that negative margins can already cause any element's edge to extend beyond the padding edge, I think we should refer to the "margin box" or "margin box edge" in more places, instead of just "the box".

Good point. I'll try to clean up that remaining imprecision in future 
revisions.

> Also, is "opposite edge" correct in that last sentence, above? Seems to me it should be "corresponding edge", so that, e.g. if 'top' is non-auto, the top edge of the element's margin box never crosses the top of the top edge of its containing block's content box. The opposite edge would be the bottom, which shouldn't matter to the non-auto 'top' value. So, perhaps something like this:

No, the opposite edge of the containing block is what limits the 
repositioning. To take a concrete example, such as sticky-top section 
headers [1], the headers stay 10px from the top of the viewport until 
their bottom edge reaches the *bottom* of their containing block, at 
which point they start scrolling with the document again. (Note that 
sticky-top only ever moves an element down.)

[1]: http://html5-demos.appspot.com/static/css/sticky.html

Corey

Received on Saturday, 13 July 2013 19:49:05 UTC