Removing a CSS rule from Custom Taxonomy

I have a universal CSS rule in my stylesheet like this:#page.grid-parent {padding-left: 20px;padding-right: 20px}What I

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
  • How about 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
Add a comment  | 

1 Answer 1

Reset to default 0

You 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

相关推荐

  • Removing a CSS rule from Custom Taxonomy

    I have a universal CSS rule in my stylesheet like this:#page.grid-parent {padding-left: 20px;padding-right: 20px}What I

    3天前
    70

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信