whitehats
Member
Posted 2 years ago #
Hi,
I am trying to use <body <?php body_class();?>> to apply different CSS rules to every template. The problem is, the properties I have specified in the CSS get mixed up. i.e. The H1 font color for body.home get applied to body.category-blog H1, although I have specified both of them separately in the CSS.
Is there a parent-child relationship between the body classes? I have not explicitly specified it so in the CSS, but does WordPress create any such relationships?
Thanks,
-Tejas
ajithkpunnoose
Member
Posted 2 years ago #
Its better to use Firebug to find out. It shown parent child inheritance and the CSS applied to each element hierarchically.
Is there a parent-child relationship between the body classes?
No. However, any given page on your site will have multiple body classes applied to it.
whitehats
Member
Posted 2 years ago #
Ajit, yes I use Firebug. That how I actually found that the class were not exclusively used for their own pages.
Esmi - is there a work-around to this?
How specific do you need this CSS to be? It could be just down to the order in the stylesheet - although I'm having trouble figuring out how the classes "home" and "category-blog" can appear on the one page.
Any chance of a url?
whitehats
Member
Posted 2 years ago #
It's on localhost currently, but I will try to push it on the server and see what we can do. Thanks!