function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
krishna casukhela 7krishna casukhela 7 

zip file static resource

Hello friends
I have a zip file say HTML5 which has three folders. i.e css , img and js .
I am using css , js and images in my visualforce page.

I saw few urls from salesforce where they say we can upload zipfile direclty in static resource.
But this isnt working when the page loads.

I am doing something like this

<apex:stylesheet value="{!URLFOR($Resource.HTML5, 'bootstrap-min.css')}"/>
But whatever combinations I try it does not work, same case with image and jquery files.

so what I did is to create a separate static resource for each file and then call in vf page , it works.

The vf page is designed using HTML5 responsive templates , HTML code. so is this preventing the styles from being applied?

Please let me know why it isnt working.

Zuinglio Lopes Ribeiro JúniorZuinglio Lopes Ribeiro Júnior
Hello Krishna,

If your CSS stylesheet is inside a folder in your Static Resource you must indicate that folder too. If I understood correctly your code should look like this:
<apex:stylesheet value="{!URLFOR($Resource.HTML5, '/css/bootstrap-min.css')}" />

When working with ZIP files you must indicate the whole path to a file. E.g.: '/path1/path2/path3/myfile.css'

In order to make your example work (<apex:stylesheet value="{!URLFOR($Resource.HTML5, 'bootstrap-min.css')}"/>) your css file should be in the root of the ZIP file.

Hope to have helped!


Don't forget to mark your thread as 'SOLVED' with the answer that best helps you.