• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.4 Different backgrounds for different categories?

#1
Hi all,

So I want to match a background color/image for the whole page, that will match these headers.

I've been reading many threads on this trying to figure out how to do it. Most address having different colors in the categories backgrounds. A few suggestions, though, so I've tried this here:

body.node2
{
background: #123456 url('path/to/background2.gif') repeat top;
}

body.node8
{
background: #000000 url('path/to/background8.gif') repeat top;
}

I've even tried tweaking it and try a few variants, but... no joy. Am I missing a step, a setting in the Admin, etc.?

Thank you in advance!

Andre
 

Attachments

Last edited:

Brogan

XenForo moderator
Staff member
#4
The principle is the same.

If you are using pages for categories then the template class is category_view.
You will then need to construct CSS utilising that class and the category node ID.
 
#5
Thanks Brogan, could you give me an example of the code for one such background for the nodes?

body.node8
{
background: #000000 url('path/to/background8.gif') repeat top;
}

li.node.page.level_2.node_146 {background: #ccc;}

None of these seem to work.

Many thanks!
 
#6
category_view?

The principle is the same.

If you are using pages for categories then the template class is category_view.
You will then need to construct CSS utilising that class and the category node ID.
OK, I don't understand what this means: "If you are using pages for categories." I am using what's there, I did not make changes.
 

RDR

Well-known member
#9
Couldn't you just create a child style, update the body style property and then assign that style to the category/node?

Make these child styles non-user selectable and you have an easier system to manage I think.

Cheers,

Regs.