Css 基于A类的Col-md-9背景色

Css 基于A类的Col-md-9背景色,css,colors,nested,dependencies,selector,Css,Colors,Nested,Dependencies,Selector,我想根据博客文章的类别更改Col-md-9的背景色 /* makes the colom blue whatever the category */ .cat-md-9 {background-color: blue;} /* makes only the text area (not the entire colom) of category-A blue */ .category-a {background-color: blue;} 如果类别等于A,我现在想把整个科隆变成蓝色 可能吗

我想根据博客文章的类别更改Col-md-9的背景色

/* makes the colom blue whatever the category */
.cat-md-9 {background-color: blue;}

/* makes only the text area (not the entire colom) of category-A blue */
.category-a {background-color: blue;}
如果类别等于A,我现在想把整个科隆变成蓝色

可能吗

(文本是荷兰语,但这并不重要)。
正如你所看到的,这不是整个专栏,这有点难看。

你的问题对我来说有点难理解,但是,根据我的理解,如果
col-md-9
属于特定类别,你希望将博客文章的背景设置为蓝色

要做到这一点,通过观察你现在的做法,你可以做到这一点

col-md-9 .category-leer {
    background-color: rgba(52,210,147,0.2);
}

通过使用它,
.category leer
类只有在
col-md-9
中才会有一个蓝色的背景,谢谢Mahan\u F,我会尽量让它更清楚。您共享的代码仅在类别leer位于Col-md-9内时才对其周围区域进行着色,但是,我希望在类别leer位于Col-md-9内时对Col-md-9进行着色

If col-md-9 CONTAINS category-leer {
    col-md-9 {
        background-color: rgba(52,210,147,0.2);
    }
}
一个案例陈述会更好,因为我有4个类别,我想颜色代码