Forum How do I...?

CSS content property and SVG text

esef
Hi,

I'd like to use SVG for running content.
So I need to put for example the page number into SVG.

Seems like prince cant handle that.
In the following example, the page number will be put into the div, but not into the SVG tspan.

.page-count-target {
    content: "PAGE " counter(page);
}

<div class="page-count-target"></div>
...
<svg...>
<text x="15" y="55" class="label ">
    Page
    <tspan class="page-count-target"></tspan>
  </text>
...
esef
nevermind.
That is not well supported for SVG in any renderer.
esef
actually, this MUST NOT be supported at all:

- The content property, whose used value on SVG text elements is none.
- Additionally, the ::before and ::after generated content pseudo-elements must not apply to SVG text elements.

https://www.w3.org/TR/SVG2/text.html#Section11.10

Edited by esef