attr() CSS函数使用CSS返回所选元素的属性值
示例
您可以尝试运行以下代码来实现CSS 中的 attr() 函数
实时演示
<!DOCTYPE html>
<html>
<head>
<style>
a:before {content: " (" attr(href) ")";}
</style>
</head>
<body>
<h2>Information Resource</h2>
<p>
Resource:<a href="https://www.qries.com">Welcome to Qries </a>
</p>
</body>
</html>
登录后复制
以上就是使用 CSS 返回所选元素的属性值的详细内容,更多请关注www.92cms.cn其它相关文章!






