Does anybody out there knows how to attach a style sheet to a node ?
Having some problems with inserting a background image to different nodes

Thanks
O.

Comments

nevets’s picture

Each node has an id of the form 'node-{nid}' where {nid} is the node iid (ex: node-123). So you should be able to add to style.css something like

#node-123 {
background-image: url(image.png);
}

or
#node-123 {
background: no-repeat url(image.png);
}
and it should work using a valid path to your image (you do want to place this at the bottom of style.css and not the top).

In a quick test this worked for an png file (small) but failed for larger jpg file in Firefox 1.5. Not sure it is a format issue, size issue or browser issue. No more time to play though, hope that is enough to help.

MisterBox’s picture

I'll try it later this night , interesting way to solve my problem

Mister Box

ajundra’s picture

try the node style module: http://drupal.org/project/node_style

allows you to set css for every node.