php - 两个 wordpress 帖子的特定类

标签 php css wordpress

我有两个 wordpress 帖子,我想给它们相同的 CSS 类,在我的样式表中我说:

.postid-861 .postid-862 #masthead .site-title a.logo-image img {
display: none;
}

这是行不通的。我想念什么吗?如果我说:

.postid-861 #masthead .site-title a.logo-image img {
    display: none;
    }

它只适用于一个帖子。 请指教

最佳答案

您可以使用 , 为不同的类赋予相同的属性,如下所示使用该代码:

.postid-861 #masthead .site-title a.logo-image img , .postid-862 #masthead .site-title a.logo-image img {
   display: none;
}

假设我有类 imagetitle 并且我希望两者都有红色背景:

.image , .title {
background-color:#a30;
}

关于php - 两个 wordpress 帖子的特定类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33583466/

相关文章:

css - Customizr slider - 仅限 Firefox 中的奇怪错误

html - 当 ul 只有一个 li 标签时隐藏 ul 和 li 标签

css - 如何在 Bootstrap 4 Alpha 3 中为 <a> 添加链接样式?

wordpress - Paypal /Woocommerce - "Error Detected Your shopping cart is empty."

php - 如何使用不带where条件的mysql查询从表中获取特定行值

html - 悬停 CSS 时文本闪烁

css - WP Bakery 选项卡动画覆盖

php - 使用对象运算符循环

无论如何在 try & catch block 中显示 PHP 异常

php - 使用 PHP 在 NextCloud 中创建日历事件