Forum How do I...?

Use target-counter pointing to an element when using user stylesheet

locilocisu
When using a call like target-counter(url('#end'), page), if the css content definition is put on a user stylesheet (stylesheet attached to the conversion process by defining it on the command line call to prince), it can't find the element and returns zero all the time.

I'm wondering is there's a way around this.

Using the sample files attached, I can reproduce this using the prince GUI tool.

However if i move the css definition in a style tag on the html file itself, it works just fine.
  1. demo.css0.1 kB
  2. lorem.html17.5 kB
mikeday
Ah okay that is because the #end URL is relative to the URL of the document in which it appears. So if it appears in an external style sheet, you will need to use the full document URL, eg. "http://example.com/mydoc.html#end".
locilocisu
Got it! Thank you