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其它相關文章!






