+ Start a Discussion

Error in Static Resource

I am working on visualforce pages,In that I have written some style class,So what I have done is I put all the style classes in a single file .

<apex:stylesheet value="{!URLFOR($Resource.Styles, 'new1.css')}" />

This was not working .please help me out
Mohammed AzarudeenMohammed Azarudeen
Did u zipped your file?
Alexander TsitsuraAlexander Tsitsura
Hi aditya3,

If you had simply uploaded new1.css you could refer to it using <apex:stylesheet value="{$Resource.new1}" />

try this
<apex:stylesheet value="{!URLFOR($Resource.new1')}" />

As a common practice, if your question is answered, please choose 1 best answer. 
But you can give every answer a thumb up if that answer is helpful to you.

ya,I zipped the file,I have lot of css classes are there how can I call them
Hello Aditya3,

since you have zipped you fiels into folder , then you have to specify folder name as well.

Please try the following code 
<apex:stylesheet value="{!URLFOR($Resource.Styles,'Styles/new1.css')}" />
<apex:stylesheet value="{!URLFOR($Resource.Styles,'/Styles/new1.css')}" />

Mohammed AzarudeenMohammed Azarudeen
If you zipped your file. Upload file to Static resource  then do following,
<apex:stylesheet value="{!URLFOR($Resource.resourceName, 'folderName/fileName.css')}"/>

If there is no folder name, you can directly specify the name of the file
<apex:stylesheet value="{!URLFOR($Resource.resourceName, 'fileName.css')}"/>