+ Start a Discussion
aditya3aditya3 

Error in Static Resource

Hi
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.

Thanks,
Alex
aditya3aditya3
ya,I zipped the file,I have lot of css classes are there how can I call them
AnjithKumarAnjithKumar
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')}" />
OR 
<apex:stylesheet value="{!URLFOR($Resource.Styles,'/Styles/new1.css')}" />

Thanks,
Anjith
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')}"/>