如何在特定id下更改类的css

Cha*_*ngh 0 html css html5 css3

我有这个html我想在abc_7 id.please下帮助我改变活动类的CSS.

<label id="abc_7" data-ng-repeat="cell in timeCell" class="btn btn-default btnsmall active" style="width: 77px;"> </label>
Run Code Online (Sandbox Code Playgroud)

我写了这个

#abc_7 .active{
background-color: green !important;

}
Run Code Online (Sandbox Code Playgroud)

但它不会起作用,因为它会在#abc_7标签中找到活跃的课程请帮助我.

Pau*_*ond 6

您指定的是子项而不是具有ID和类的元素.

它应该是:(注意,ID和类之间没有空格)

#abc_7.active{
   background-color: green;
}
Run Code Online (Sandbox Code Playgroud)