I know it sounds ridiculous, but can I use a css media query in an inline style? The reason is I’m echoing a background in PHP and need to use a retina size image if the device is retina.
ie: <div style="background:url(normal.png); <- need to add style for retina device
Not within an inline style declaration as far as I know.
However, if you’re echoing from within PHP and really can’t access the stylesheet I would suggest echoing an inline
<style />element with the media query and using a class for the div.i.e.