Forum How do I...?

target-content and pseudo elements?

dsusco
I'm using target-content to create a table of contents. The targets are h1-3s, which have section numbering on their before pseudo elements. When I use target-content(attr(href)) I get the text of the target but not the pseudo content. Is there anyway I can get that too?

Basically my ToC is:

Heading 1
Heading 1.1
Heading 2

And my headings are:

1.0 Heading 1
1.1 Heading 1.1
2.0 Heading 2

I'd like my ToC to be the same.

mikeday
At the moment you need to use target-counter() in the toc, as there is no way to capture pseudo-elements with target-content (yet).