Hi,
Without having to create many new page templates and modifying classes etc in the html markup, I have been trying to find a way to override the css of my site for certain pages/content.
I have just tried the Css Injector module, but the css file it creates is useless as it occurs in the head before the theme css and module css files.
In otherwords the css I create using Css Injector is basically ignored by the browser as the css from the themes and modules get referenced later, and so get greater precedence.
This basically changes my CSS Injector created css.
Is there a way to make the css file created by Css Injector to appear last?
or
Is there a better module to modify css on a page by page basis etc?
Please help.
I am trying to create some simple way for some content creators to be able to modify css rules etc for the pages they create.
Thanks,
Sam
Comments
Use !important
Css injector recommends that you use the built in css functionality !important to ensure that a rule is not overwritten.
If your rule is being overwritten by the theme, add !important to the end of your css rule before the semicolon. Here is an example
Code that does not work
Code that does work
If that still doesn't solve the problem, make sure that you clear your cache under performance.
or give the body a class
In your page.tpl.php, edit the body tag to add a class name. Now you can precede your css rule with body.myclassname to make it more specific ie:
body.myclassname .views-row{margin:10px;}which will override
.views-row{margin:10px;}