I would like to add a different style sheet to some (not all) pages.
How can this be done?

Comments

grobemo’s picture

I think you could use the CSS Injector module. Otherwise, you'll want to use drupal_add_css in your template.php file. (Google around for ways to do that.)

That said, if what you want is just to style different node types differently, it might be better to keep all the styles in a single style sheet. You can target your styles to specific nodes with careful use of classes. For instance, if you look at the <body< tag in this page's source code, you'll see that is has the class 'node-type-forum'. Thus, the following declaration would target any div of class 'sample-class' on forum pages without affecting those divs on any other page:

body.node-type-forum div.sample class {
  // Do some styling here...
}
Anonymous’s picture