You need to sign in to do that
Don't have an account?

problem referencing image in static resource from my css
I have a zip file that includes both images and css files that I've uploaded as static resources.
In my css file, I have a style rule that references one of the images in the archived as a background image like so:
.even{background:transparent url('images/gradient-alt-row.gif') repeat; height:60px;}
In my visualforce page, I reference the stylesheet like so:
<apex:stylesheet value="{!URLFOR($Resource.event,'css/events.css')}"/>
When I load the page, the background image is not displaying. I've checked the style rule in Firebug and I can find the style rule, but Firebug indicates that the image failed to load.
Does the code above appear incorrect? I've read the documentation and it shows this is the proper way to reference the image in the css?
Has anyone encountered this issue?
Any help is appreciated.
Thanks.
When you include the stylesheet, your "current working directory" is effectively 'css'. Thus if your images directory sits at the same level as your css directory in the zip file, you'll need to give a relative path to find the images directory - ../images/
Thus your markup should be :
All Answers
When you include the stylesheet, your "current working directory" is effectively 'css'. Thus if your images directory sits at the same level as your css directory in the zip file, you'll need to give a relative path to find the images directory - ../images/
Thus your markup should be :
Thanks Bob! I appreciate it!