2

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>
2
  • 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) Commented Apr 17, 2014 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 Commented Apr 17, 2014 at 10:12

1 Answer 1

2

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

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

5
  • Yes @jaffer. You are correct. It's working Commented Apr 17, 2014 at 10:13
  • 2
    Cool..Please mark it solved so other can see .. Cheers :) Commented Apr 17, 2014 at 10:14
  • Wait for 3 more minutes :P Commented Apr 17, 2014 at 10:16
  • 29 minutes are gone:P Commented Apr 17, 2014 at 10:46
  • I'm sorry. Done =) Commented Apr 17, 2014 at 12:05

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.