Can CSS access the content of an element as it can the attributes? [duplicate]
Possible Duplicate:
'content' attribute to inherit node value
I know you can access the content of an element's attribute like this:
a[href]:after { content: " (" attr(href) ")"; }
Is there a way to access the actual textual content of the element? What I need to do is make an <h2>
on the page appear as if it's duplicated (for styling purposes) without actually having it duplicated in the markup.
I can't pull this off with a simple text-shadow
because I need this duplicated version to appear behind an image while the original appears above.
The following may help
E::first-line the first formatted line of an E element
E::before generated content before an E element
E::after generated content after an E element
However I beleive what you want to do can be done by z-index and position:relative or position:absolute. Use js to duplicate the h2 tag and add a class to position it behind the image.
精彩评论