I wanna pick the src attribute value on the HTML and pass it to the css/scss file in a variable to be able to just add it to the url() property:
<style>
img[src]{
background-image:url(attr(src));
}
</style>
And for every different img just grab their src value, add it inside the url property and make it the background image so I don't have to code a lot or code each single different image.
-
I've tried but does not work, i also tried using custom properties but i wanna confirm that there is no way to do this or a similar solution.
Thanks