「CSS入門」attr()関数で属性値を取得するサンプル
書式
a:after {
content: " (" attr(href) “)";
}
サンプルコード
<style>
a:after {content: " (" attr(href) ")";}
</style>
<p><a href="//www.sample.com">sample study</a></p>
<p><a href="//www.sample.com/html/">html study</a></p>