attr

The attr() CSS expression is used to retrieve the value of an attribute of the selected element and use it in the style sheet. It can be used on pseudo-elements too and, in this case, the value of the attribute on the pseudo-element’s originated element is returned.
Example :

<!DOCTYPE HTML>
<html>
    <head>
        <title>CSS Tutorials</title>
        <style>
            p:before {
                content: attr( data-foo) " ";
            }
        </style>
    </head>
    <body>
        <p data-foo="hello">
            world
        </p>
    </body>
</html>

Output :

hello world