admin管理员组文章数量:1404347
There is a universal CSS class which does this:
.inside-article {
background-color: #ffffff;
}
What I'd like to do is change the color to #393939 on a specific Post ID of 6238.
This doesn't seem to work:
.postid-6238 .inside-article {
background-color: #393939;
}
Am I doing something wrong here?
Thanks!
There is a universal CSS class which does this:
.inside-article {
background-color: #ffffff;
}
What I'd like to do is change the color to #393939 on a specific Post ID of 6238.
This doesn't seem to work:
.postid-6238 .inside-article {
background-color: #393939;
}
Am I doing something wrong here?
Thanks!
Share Improve this question asked Jan 31, 2020 at 16:19 HenryHenry 9831 gold badge8 silver badges31 bronze badges 1 |1 Answer
Reset to default 0This may not solve the problem necessary because there may be other rules in your theme that have higher specificity and will overrule your selectors but
You need to combine the selector together, like so:
.postid-6238.inside-article {
background-color: #393939;
}
That selector will choose for all elements that have BOTH the classes .postid-6238 and .inside-article in them.
If you have them separated:
I've seen themes that will assign an id to the post-id instead of a class
本文标签: cssChange a div background color on Post ID
版权声明:本文标题:css - Change a div background color on Post ID 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744786510a2625032.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
!important
. – Vitauts Stočka Commented Jan 31, 2020 at 16:28