W3C home > Mailing lists > Public > www-style@w3.org > August 2012

[css3-break] addressing individual box fragments

From: Cameron McCormack <cam@mcc.id.au>
Date: Tue, 14 Aug 2012 17:53:16 +1000
Message-ID: <502A03EC.60807@mcc.id.au>
To: "www-style@w3.org" <www-style@w3.org>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:58 GMT