Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Inline css is working. But I'm unable to call from an external css the same code.

Following is in VF..

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

And my style.css content in Static Resource...

  <style type="text/css">
   div.col1{
   background-color: #ccffcc;
   }
   div{
       float:left;
      }
       div.border{

      border-style:outset;
      border-width:6px;
      }
     .errorClass {
      background-color: red;
     }
    .normalClass {
     background-color: green;
     }
    .inProgressClass {
    background-color: #33CCFF;
    }
   .centerClass
    {
    align:center;
   }
  </style>
share|improve this question
    
What exactly you can't call? A whole css file or just individual classes? If it is a whole css file problem i think this is related to the question about adding images (look here) –  mast0r Apr 17 '14 at 10:09
    
I have a color coding in a data table where "errorClass ", "normalClass" colors a cell. I have no images. If I paste it inside VF, it works, but if I use it in static resource nothing happens –  MnZ Apr 17 '14 at 10:12

1 Answer 1

up vote 1 down vote accepted

URLFOR is used when style sheet exist under zipped folder. In your case try this:

<apex:stylesheet value="{!$Resource.style}"/>

share|improve this answer
    
Yes @jaffer. You are correct. It's working –  MnZ Apr 17 '14 at 10:13
2  
Cool..Please mark it solved so other can see .. Cheers :) –  Jaffer Ali Apr 17 '14 at 10:14
    
Wait for 3 more minutes :P –  MnZ Apr 17 '14 at 10:16
    
29 minutes are gone:P –  Jaffer Ali Apr 17 '14 at 10:46
    
I'm sorry. Done =) –  MnZ Apr 17 '14 at 12:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.