You can display content of attributes via CSS: You can use any attribute, not just data-attributes. You can't do any string manipulations like truncating the #
from the rendered text tough.
p::before {
content: attr(data-test);
}
a::before {
content: attr(href);
}
<p data-test="Hello"> World </p>
<a href="#Hello"> World </a>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…