Re: Proposal: Fixed Table Headers in CSS

On Tue, Dec 15, 2009 at 4:17 PM, Brad Kemper <brad.kemper@gmail.com> wrote:
> I see what you mean now about accumulating. You don't want the H2 to push
> the h1 in it's grandparent off, right? But I don't see how you prevent that
> if the 'top' of the H2 is relative to the offscreen top of the section.

The two values are relative to the same edge, *but* in my conception
sticky elements somehow never overlap, just like floats.  How this
works, precisely, when you're mixing top-sticky and left-sticky
elements, frex, is up in the air.

> You
> could do something like the following to prevent the H1 from being pushed
> off:
>
> h1 { position: sticky; top: 0; }
> h2 { position: sticky; top: 2am; }

Nah, that doesn't work well.  If you have another <h1> further down,
it would (1) overlap the current sticky <h2> temporarily before it
displaced the <h1>, and (2) display the last <h2> of the previous
section until a following <h2> displaced it. (Well, it would do so in
the first example.  The second example would work properly, assuming
that the <h1> was 2em tall.)

I'm also not certain how your idea of this working actually causes
things to be displaced.  The way you're stating it it seems like later
sticky things just overlap previous ones, hiding them behind.

~TJ

Received on Tuesday, 15 December 2009 22:28:10 UTC