简体   繁体   English

两个Wordpress帖子的特定类别

[英]Specific class for two wordpress posts

I have two wordpress posts that I want to give them the same CSS class, in my style sheet I say: 我有两个wordpress帖子,我想给他们相同的CSS类,在我的样式表中我说:

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

This does not work. 这是行不通的。 Do I miss anything? 我想念什么吗? If I say: 如果我说:

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

It will work for one post only. 它仅适用于一个帖子。 Please advice 请指教

You can give same properties to different classes by using , as below use that code: 您可以使用来为不同的类赋予相同的属性,如下所示,使用该代码:

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

let's say i have class image and title and i want both to have red background: 假设我有课程imagetitle并且我都想拥有红色背景:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM