Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A better way for me to have phrased this question (in hindsight) would have been "How can you access content generated automatically by CSS without using JavaScript?", and that these questions are relevant:</p> <ul> <li><a href="https://stackoverflow.com/questions/2358107/is-it-possible-to-access-the-content-generated-by-a-css-before-rule">Is it possible to access the content generated by a css :before rule?</a></li> <li><a href="https://stackoverflow.com/questions/2651739/how-to-access-css-generated-content-with-javascript">How to access CSS generated content with JavaScript</a></li> </ul> <p>It looks like accessing the automatically generated counter values is not easy even with JavaScript, and not possible without it, so that answers my question.</p> <p>There are a number of documents from the W3C that discuss counters and generated content, but none as far as I could tell discuss referencing generated content from other parts of a document:</p> <ul> <li><a href="http://www.w3.org/TR/css-counter-styles-3/" rel="nofollow noreferrer">CSS Counter Styles Level 3</a></li> <li><a href="http://www.w3.org/TR/2011/WD-css3-lists-20110524/" rel="nofollow noreferrer">CSS Lists and Counters Module Level 3</a></li> <li><a href="http://www.w3.org/TR/2003/WD-css3-content-20030514/" rel="nofollow noreferrer">CSS Generated and Replaced Content Module</a></li> </ul> <p>There <em>is</em> <a href="http://www.w3.org/TR/1998/NOTE-CSS-potential-19981210#id10710829041" rel="nofollow noreferrer">a note in the W3C's <em>List of suggested extensions to CSS</em></a> that mentions exactly the cross-reference problem - it comes from an email written in <em>1998</em>, and I haven't found any follow-up work, so I guess this wasn't a high priority.</p> <p><strong>Update</strong></p> <p>The <a href="http://www.w3.org/TR/css3-gcpm/" rel="nofollow noreferrer">CSS Generated Content for Paged Media Module</a> <a href="http://www.w3.org/TR/css3-gcpm/#cross-references" rel="nofollow noreferrer">discusses cross references explicitly</a>, and describes the <code>target-counter</code> and <code>target-text</code> functions to implement them with CSS. However, this is a working draft dated 29 November 2011; these functions don't appear to be implemented in any major browser. An <a href="http://alistapart.com/article/building-books-with-css3" rel="nofollow noreferrer">article from A List Apart</a> talks about using these CSS features to produce PDF eBooks from HTML using some random propriety tools.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload