Use PHP in stylesheet to specify a background image based on Category ID

Stylesheets can hold only CSS.

If you make use of the body_class() function, then you get classes for nearly every request. You can then define those classes (ex. backgrounds) inside your stylesheet.

Add this inside your templates: <body <?php body_class(); ?>> (if you haven’t already got it).