Is it possible to pass the value of a node into the content
attribute?
For example, if the value of an <h2/>
tag is "Random title", can I use this value inside the content
attribute in CSS?
I have attempted using content: inherit;
, but it does not appear to be effective.
Here is an illustration of my concept:
HTML:
<h2>Random title</h2>
CSS:
h2:after {
content: inherit; /* should display as "Random title" */
}
Thank you in advance!