For example: set the color value of the <a></a> tag using the value of the value attribute of the <input /> :

 <a>text</a> <input type="text" value="red"/> 

PS already searched and decided that it is impossible, but suddenly underestimated css3 ...

And why even such a construction does not work:

 <input type="text" style="color: attr(value color)" value="#f00" /> 

Thank!

    1 answer 1

    Currently, attr() supported only for the content property. See the compatibility table on MDN .

    • It was in the CSS 2.1 version, even when clicking on your link it is written: "The attr () expression can be used with any CSS property." - michael
    • Scroll down to Browser Compatibility at the end of the page. According to the specification can be used with any. But support is experimental, and is absent everywhere. - Pavel Azanov 1:43 pm
    • Yeah, the situation is not very. I think that if such a trouble is with attributes, then there is no need to hope for support of taking attributes from other elements for use in properties by means of css in the near future. - michael