Jason Knight
Aug 19, 2022

--

CORRECTION, if I really had to do it, I'd use a data- attribute and the attribute function.

<section data-image="url(images/test.png)">

section { background-image:attr(data-image); }

Should work. I might do an article on passing data to CSS when it's presentation the server needs to control, but only for specific media targets.

--

--

Jason Knight
Jason Knight

Written by Jason Knight

Accessibility and Efficiency Consultant, Web Developer, Musician, and just general pain in the arse

No responses yet