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
kaixarkaixar 

Having problem with "myStyles"

I'm using myStyle variable as mentioned in code line: <apex:stylesheet value="{!URLFOR($Resource.myStyles, 'newStyles.css')}" />

but it gave ene error like Error: Static Resource named myStyles does not exist. Check spelling

 

any suggestions?

kiranmutturukiranmutturu

did you upload the resource in static resource?

kaixarkaixar

static resource? how to do that?

pardons me, m new to SFDC.

Chamil MadusankaChamil Madusanka

The <apex:stylesheet> tag references a CSS style sheet that is saved as a static resource named TestStyles in Your Name > Setup > Develop > Static Resources. It is referenced by the $Resource global variable in the <apex:stylesheet> tag's value attribute. The styleClass attribute of the <apex:outputText> tag uses the sample style class defined in the style sheet.

 

<apex:page>
<apex:stylesheet value="{!$Resource.TestStyles}"/>
<apex:outputText value="Styled Text in a sample style class" styleClass="sample"/>
</apex:page>

 If you intend to use images in your stylesheet, zip the images with the CSS file and upload it as a single static resource. For
example, if your CSS file has a line like the following:

 

body { background-image: url("images/dots.gif") }

 

Add the entire images directory and the parent CSS file into a single zip. For example, if the zip file resource name is
myStyles, refer to it like this:

 

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

 For more details : http://wiki.developerforce.com/page/Using_the_Salesforce_CSS_in_Your_Apps

 

If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.