I have situation where design states to use two different images for background image(one for desktop, other for mobile). Those images are uploaded through CMS therefore I can retrieve URLs of one and other image using PHP.
Is there a way to pass these URLs as attributes or any other way to pass for my CSS to use?
I need some media queries based on height and width, therefore using javascript/jquery would be a pain.
I tried this:
background-image: attr(data-desktop url);
where data-desktop is as an attribute of element and contains needed url, but no luck with this code.
Any suggestions or links would be a great help.