[css3-break] addressing individual box fragments

I would like to be able to specify some generated content that would be 
used if a given box is broken across pages.  I have a code listing that 
might, depending on where it ends up on the page, span two pages.  I'd 
like to be able to insert a note at the bottom of the box fragment on 
the first page to say for example "(continued on next page)".

The natural way for me to think about this is to be able to address 
individual box fragments with a pseudoelement.  If there were a 
::fragment pseudoelement, and ::first-fragment & ::last-fragment 
pseudoclasses, then something like this might work:

pre.code-listing::fragment:not(:last-fragment)::after {
   display: block;
   content: "(continued on next page)";
}

Being able to change arbitrary properties of the box fragments 
themselves might complicate the model too much, though.  And maybe you'd 
need a break-before:avoid-page in there too so that the generated 
content didn't get moved to the next page.

Received on Tuesday, 14 August 2012 07:53:51 UTC