Activity › Forums › Salesforce® Discussions › How to refer static resources in Salesforce Visualforce?
-
How to refer static resources in Salesforce Visualforce?
Posted by Aman on September 22, 2018 at 5:01 PMHow to refer static resources in Salesforce Visualforce?
Parul replied 7 years, 7 months ago 3 Members · 3 Replies -
3 Replies
-
CSS file
<apex:stylesheet value=”{!URLFOR($Resource.style_resources, ‘styles.css’)}”/>
- [adinserter block='9']
-
-
Suppose there is a single file like any single image or standalone css file, that you need to refer in your VF page, then you can directly use the “$Resource.resourceName” to refer the static resource where ‘$Resource‘ is a global variable to use any static resource within visualforce page. You need not to hard code the path of the static resource in VF page code. Below are some examples of the same.
<apex:stylesheet value=”{!URLFOR($Resource.style_resources, ‘styles.css’)}”/>
Log In to reply.