Need to change the background on child pages

Hi All

I am maintaining a site that has been created using Drupal. The site has different backgrounds on a number of pages. These are selected in the css as follows

Content {
background: url(‘…/images/bg_content.png’) no-repeat;
}

.page-lolliland Content {
background: url(‘…/images/bg-land_sky.png’) no-repeat;
}

.page-lollifactory Content {
background: url(‘…/images/bg-sky.jpg’) no-repeat;
}

At the moment this works fine.

I have been asked to add some pages under the lolliland parent and also under the lollifactory parent.

The pages under the lolliland branch need to have the same background as the lolliland parent and those under the lollifactory parent need to have the same background as the lollifactory parent.

How can I target these child pages so that I can set their backgrounds. Everything I am trying is not working and I am stuck with the default content background.

Thanks in advance

Richard

Maybe I’m dense, but I still don’t know what a child page is.

A child page on this site would be a page in the navigation tree under the parent.

If /lolliland is the parent then /lolliland/other has one child page named other

Regards

Richard

is drupal inserting the page classes in the BODY tag?.. check your source after it’s been output. it maybe failing to do place the tag. Your rules are right under the following assumption :

<body class=“page-lolliland”>… <div id=“content”>
also the bg images will display in the<div id=“content”> not the bg of the page… but I think that’s what you want , right?

If you don’t see any bg at all AND your original page had no bg to begin with, it is possible that your Content div is not auto clearing. So the bg is there, you just aren’t seeing it because the div has collapse. IF this is the case add overflow:hidden; to your Content{} rule.

hope that helps

I think I get it. Do this…

.page-lollifactory Content, .childPageClass Content {
background: url(‘…/images/bg-sky.jpg’) no-repeat;
}

Hi Eric

I tried your suggestion and it does nothing

Regards

Richard

Everyone’s suggestion of setting a class on the body should work for you.

Page Specific Backgrounds

That example will show you the basics of it.