I've got a (most likely not) unique problem having a css background div I'm seeking suggestions about. I'm using Wordpress, which produces my pages dynamically. The leading page plus some other pages are utilizing one sort of background (Gradient) while internal pages are utilizing a good whitened. Right now i'm instructed to have two style sheets - primary.css for that gradient background, then internal.css for that internal - for this purpose background div.

It is possible to method to play one css file and take care of both of these background divs easily? I'll most likely want to use a little of php...

Basically I'm only attempting to pass two different background divs, on either home or some internal pages.

Only use different template files (which you ought to be doing anyway due to the various looks), and employ something similar to an ID on our bodies tag to check on such as this:

<body id="grad">


<body id="white">

And employ this inside your stylesheet:

#grad {
#white {

Make certain to look into the template hierarchy page within the WordPress codex to determine the best way to easily produce the template files you'll need. Use #grad home based.perl and/or perhaps a custom template file the application of for your top of the page (whether it's static), after which use #during anything else (category.php, tag.php, single.php, and page.php are most likely the fundamentals).

' else ?>

You could utilize your normal stylsheet on all of the pages, using the solid whitened background set. After that time your top of the page along with other 'special' pages, you might have a tag using the background image which will override the whitened:

<link rel="stylesheet" type="text/css" href="main.css" /><!-- This has background-color:white; -->
<?php if(!empty($special)){
echo <<<HTML

Then you'd just set $special to true or something like that when you are on the 'special' page.

I did not think about this but this is actually the code:

<body<?php if ( !is_home() ) echo ' style="background-image: url(images/about_bg.png);"'; ?>>

Place it within the header.