I have enabled LessCSS on my site and I have a node instance where I want to add a specific CSS.

I used the following piece of code:

<?php
    drupal_add_css( '/sites/MyStuff/introduction.css');
?>
<div id="myid" class="box">
    ....some text
</div>

Yet, there is no import or link statement in my page source code for introduction.css. I am not using compression. FireBug does not mention loading an introduction.css file. I have doubled-checked and the file is properly located in the folder.

What could cause this issue? And how to solve it?

P.S.:

The css file contains the following:

.box {
    color: green;
    background-color: red;
}

The styling is not applied on the page.

link|improve this question

Try drupal_add_css( 'sites/MyStuff/introduction.css');, without the leading '/' – Clive Apr 29 at 17:14
I tried but it did not work. Apparently, it is too late in the process to call this method (i.e., from the node body), says: stackoverflow.com/questions/1410494/drupal-add-css-not-working – JVerstry Apr 29 at 17:26
feedback

1 Answer

up vote 0 down vote accepted

From http://stackoverflow.com/questions/1410494/drupal-add-css-not-working, the solution is to use CSS Injector. I tried and it worked.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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