I have a universal CSS rule in my stylesheet like this:
#page.grid-parent {
padding-left: 20px;
padding-right: 20px
}
What I'd like to do is REMOVE that rule from some Custom Taxonomy Archive Pages I have.
So, if I look at the body tag of an example page I see this:
<body class="archive tax-country term-saudi-arabia term-445 wp-custom-logo wp-embed-responsive cookies-set cookies-accepted post-image-below-header post-image-aligned-center no-sidebar nav-float-right fluid-header separate-containers active-footer-widgets-0 header-aligned-left dropdown-hover elementor-default" itemtype="" itemscope>
I am sure that I can use the "tax-country" as the hook to hide that CSS rule.
To hide the CSS rule from those pages I tried this:
#page.grid-parent.tax-country {
padding-left: 0px;
padding-right: 0px
}
....and it didn't work...
I also tried to use the #tax-country ID like this:
#tax-country.grid-parent {
padding-left: 0px;
padding-right: 0px;
}
And still no joy...
I have a universal CSS rule in my stylesheet like this:
#page.grid-parent {
padding-left: 20px;
padding-right: 20px
}
What I'd like to do is REMOVE that rule from some Custom Taxonomy Archive Pages I have.
So, if I look at the body tag of an example page I see this:
<body class="archive tax-country term-saudi-arabia term-445 wp-custom-logo wp-embed-responsive cookies-set cookies-accepted post-image-below-header post-image-aligned-center no-sidebar nav-float-right fluid-header separate-containers active-footer-widgets-0 header-aligned-left dropdown-hover elementor-default" itemtype="https://schema/Blog" itemscope>
I am sure that I can use the "tax-country" as the hook to hide that CSS rule.
To hide the CSS rule from those pages I tried this:
#page.grid-parent.tax-country {
padding-left: 0px;
padding-right: 0px
}
....and it didn't work...
I also tried to use the #tax-country ID like this:
#tax-country.grid-parent {
padding-left: 0px;
padding-right: 0px;
}
And still no joy...
Share Improve this question asked Feb 10, 2020 at 23:07 HenryHenry 9831 gold badge8 silver badges31 bronze badges 1 |1 Answer
Reset to default 0You can try this below CSS. I think, It will work.
.tax-country #page.grid-parent {
padding-left: 0px;
padding-right: 0px
}
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744759733a4592101.html
body.tax-country #page.grid-parent
? But CSS questions like this is better asked on Stack Overflow. – Sally CJ Commented Feb 10, 2020 at 23:56