Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html Css和AngularJS:如果一个类是使用ng类生成的,我如何在Css选择器中嵌套两个类_Html_Css_Angularjs - Fatal编程技术网

Html Css和AngularJS:如果一个类是使用ng类生成的,我如何在Css选择器中嵌套两个类

Html Css和AngularJS:如果一个类是使用ng类生成的,我如何在Css选择器中嵌套两个类,html,css,angularjs,Html,Css,Angularjs,如果其中一个类是使用angular js中的ng类生成的,那么如何在css选择器中嵌套两个类呢。我的代码如下所示 <input class="form-control class-inputs" ng-class="{'active' : condition here...}" /> <input class="form-control class-inputs" ng-class="{'active' : condition here...}" /> <input

如果其中一个类是使用angular js中的ng类生成的,那么如何在css选择器中嵌套两个类呢。我的代码如下所示

<input class="form-control class-inputs" ng-class="{'active' : condition here...}" />
<input class="form-control class-inputs" ng-class="{'active' : condition here...}" />
<input class="form-control class-inputs" ng-class="{'active' : condition here...}" />
问题是背景色没有变为红色。
我的目标是使用ng类更改活动按钮的颜色,如果条件为真,则颜色应更改为红色。

在您的情况下,我认为这将起作用:

.active {
  background-color : red;
}
请参阅css选择器

普朗克:

同时检查您的状况是否为
true


请检查小提琴

类输入,以供参考。活动{background color:red;}不起作用:(只要类的名称相同,输入的数量就无关紧要………将使类
处于活动状态的元素将变为红色,无论它们有多少个。这是html中
的基本属性之一。编辑了答案……我错过了起始点(.)在class
class inputs
…立即尝试我认为它不起作用。您将在嵌套在带有
class inputs
class的元素中的元素上,将背景色设置为红色。我想您是对的。我不明白这个问题……但是将活动类设置为红色如何……这样会使
背景变红d-color:red
到那些具有
活动的
类的输入。您确定该条件的计算结果为
?您的CSS很好。
.active {
  background-color : red;
}
.class-inputs.active {
    color: red
}
.class-inputs.active{
    background: red;
}