attr() CSS函數(shù)使用CSS返回所選元素的屬性值
示例
您可以嘗試運(yùn)行以下代碼來實(shí)現(xiàn)CSS 中的 attr() 函數(shù)
實(shí)時演示
<!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>
登錄后復(fù)制
以上就是使用 CSS 返回所選元素的屬性值的詳細(xì)內(nèi)容,更多請關(guān)注www.92cms.cn其它相關(guān)文章!