Home > Article > Web Front-end > Return the property value of a selected element using CSS
attr() CSS function returns the attribute value of the selected element using CSS
You can try running the following code to implement the attr() function
Real-time demonstration
<!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>
The above is the detailed content of Return the property value of a selected element using CSS. For more information, please follow other related articles on the PHP Chinese website!