admin管理员组文章数量:1394228
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
}
本文标签: Removing a CSS rule from Custom Taxonomy
版权声明:本文标题:Removing a CSS rule from Custom Taxonomy 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744759732a2623682.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