0

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.

2

1 Answer 1

0

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

Update

I maintain a page explaining how to use CSS Injector too add CSS to a page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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