Hi, I have a requirement whereby I need images added within EE posts to be outputted as backgrounds within a CSS class.
I have tried to think this out and get this done but have drawn a blank each time and not so sure EE is capable of achieving this.
Below is how I have it at the moment, which is placing an image AND the text within an unordered list along with some inline styles to force alignment - plus the image resizer to resize to the exact size:-
{exp:channel:entries channel="dj_charts" orderby="title" limit="10"}
<li class="djs">{exp:imgsizer:size src="{dj_photograph}" width="40" height="40"}
{sized}
{/exp:imgsizer:size}
title}</li>
{/exp:channel:entries}Not only is this clunky but it doesnt allow me to pad the text out and fit nicely inline with the image. Is there a method where I can output this so that the image is placed and resized as a background image within the CSS instead, say like below which would output the relevant image?
li.djs {background:url("{dj_photograph}") no-repeat #fff;display: block;height: 40px;line-height: normal;margin: 0 10px 1px 10px;padding: 0;}As far as Im aware, you cant add EE tags in CSS, is this the case?
Any help would be appreciated.
Thanks
Scott