使用 CSS 返回所选元素的属性值

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 返回所选元素的属性值的详细内容,更多请关注双恒网络其它相关文章!

简简单单挺好的

联系我们 订单查询