Usage of attr() CSS function

The attr() CSS function returns the value of an attribute of the selected element using CSS

You can try to run the following code to implement the attr() function in CSS


Live Demo

<!DOCTYPE html>
         a:before {content: " (" attr(href) ")";}
      <h2>Information Resource</h2>
      <p>Resource: <a href = "">Welcome to Qries </a></p>
Lakshmi Srinivas
Lakshmi Srinivas

Programmer / Analyst / Technician