string-set sets only first occurance of element on page
Given code:
@page {
@bottom-center {
content: string(title);
}
}
h2 {
string-set: title content(text);
}
If there are two h2
elements on the same page, @bottom-center
of this page will be set to the value of first one, and that's OK. But following pages will have the same value, too, and that's NOT OK.
You can test the example here.
I am aware of position: running()
elements, but in my case this solution is inconvenient as then I'll have to add extra element for this purpose, but HTML file in my case is generated by external tool and this tool do not have to be aware of this feature.