Re: For printing: Select the element preceded immediately by a page-break?

I was envisioning something like...

@media print {
   #some_div:after-page-break {
      background-color: #ff0;
      border: 1px solid #000;
      content: attr(data-header);
   }
}

<div id="#some_div" data-header="This is some static header for regions
that need a repeatable header element in print preview.">
  <!-- stuff -->
</div>


On Tue, Jun 10, 2014 at 4:06 PM, Tab Atkins Jr. <jackalmage@gmail.com>
wrote:

> [sorry for the delay in responding - I was travelling most of May, and
> am working through backlog now]
>
> On Wed, Apr 30, 2014 at 2:38 AM, Scott Arciszewski
> <kobrasrealm@gmail.com> wrote:
> > Hello,
> >
> > I've run into a problem where, when I want to print a webpage, for only a
> > subset of document, I'd like to have a repeated header.
> >
> > The simplest way I can think to implement this is to just re-draw the
> same
> > element after each page-break. However, there is currently no way (as
> far as
> > I can tell) to do this with CSS.
> >
> > I'd like to suggest an :after-page-break selector that only has meaning
> > inside @media print { } as a way for documents to be "aware" of when a
> > page-break has occurred.
> >
> > However, I'm not very emotionally attached to his particular suggestion
> if a
> > more elegant solution can be proposed.
>
> How do you envision this working?  Selectors apply to elements, but it
> sounds like you want to *create* an element after each page break.  Is
> this right?
>
> ~TJ
>

Received on Wednesday, 23 July 2014 14:22:18 UTC