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

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

From: Scott Arciszewski <kobrasrealm@gmail.com>
Date: Tue, 10 Jun 2014 20:21:50 +0000
Message-ID: <CAPKwhwthNfeyE-D67-5s1NA7tkx2_t_aMFcLDVvKCxbeZ1Bckg@mail.gmail.com> (sfid-20140610_202158_499767_7CAEFD03)
To: www-style@w3.org
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

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:23 UTC