Can you apply the ccs rule content to child elements?
css :
a:link:before, a:visited:before{
content: " "attr(href)" ";
}
html :
<a href="/home">Home</a>
Result :
-------------
| /home |
| Home |
-------------
However I would like to do the following:
html :
<a href="/home"><span>home</span></a>
With the previous css the href value would appear before the span.
Is it possible to make it appear in the span?
I’ve tried this. It’s for a sitemap.
No, that’s not possible.
To make generated content render inside the
span, you needa:link span:before.Unfortunately, in that case,
content: " "attr(href)" ";will no longer work, because theaelement is no longer the subject of the selector – thespanis, and thespandoes not have thehrefattribute.