Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/haskell/10.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
Javascript CSS禁用表中的输入';s列背景色和表中的选定行_Javascript_Html_Css_Angularjs - Fatal编程技术网

Javascript CSS禁用表中的输入';s列背景色和表中的选定行

Javascript CSS禁用表中的输入';s列背景色和表中的选定行,javascript,html,css,angularjs,Javascript,Html,Css,Angularjs,我会提前说CSS是我的弱点。我创建了一个angularJs表,其中包含以下ng repeat语句: @Labels.itemId @昵称 @标签.说明 @数量 @标签.位置 @成本 选中行时显示绿色的原因是,输入的背景设置为40%不透明度(alpha),而蓝色背景正在渗出: .smYellow { background-color: rgba(250,243,126, 0.40); // R,G,B,alpha } 因为蓝色+黄色=绿色,所以绿色就是你所看到的

我会提前说CSS是我的弱点。我创建了一个angularJs表,其中包含以下ng repeat语句:


@Labels.itemId
@昵称
@标签.说明
@数量
@标签.位置
@成本

选中行时显示绿色的原因是,输入的背景设置为40%不透明度(alpha),而蓝色背景正在渗出:

    .smYellow {
      background-color: rgba(250,243,126, 0.40);  // R,G,B,alpha
    }
因为蓝色+黄色=绿色,所以绿色就是你所看到的。将不透明度(alpha)设置为100%,无论选择什么,输入都应显示纯黄色:

    .smYellow {
      background-color: rgba(250,243,126, 1);    // R,G,B,alpha
    }
    .table-list > tbody > tr.selected td > input.smYellow{
      background-color: rgba(250,243,126, 0.4); // put your new matching color here
    }
或者,您可以制定另一个更具体的规则,允许您在选择行时设置不同的颜色:

    .smYellow {
      background-color: rgba(250,243,126, 1);    // R,G,B,alpha
    }
    .table-list > tbody > tr.selected td > input.smYellow{
      background-color: rgba(250,243,126, 0.4); // put your new matching color here
    }

这将要求您删除
!您的
smYellow
规则中的重要声明。

这是我的最终解决方案,似乎效果良好。我保持原样

再次感谢您的帮助:

.smOrange{
填充:#F58025;
填充不透明度:0.4;
行程:#F58025;
笔画宽度:3;
背景色:rgba(245128 37 0.40)!重要;
}
smYellow先生{
填充物:#faf37e;
填充不透明度:0.4;
冲程:#faf37e;
笔画宽度:3;
背景色:rgba(250243126,0.40)!重要;
}
.table list>tbody>tr.selected td>input.smYellow{
背景色:rgba(250243126,0.60)!重要;
}
.table list>tbody>tr.selected td>input.smOrange{
背景色:rgba(245128 37 0.60)!重要;

}
您能给我们举个代码示例吗?根据我试图从你的问题中理解的内容,我制作了这样一个示例代码——是的,你的示例说明了我的问题。如您所见,高亮显示的行是绿色的,而未高亮显示的行是黄色的。我想要黄色的,不考虑高光。我一直在考虑为所选行设置条件的额外ng类(可能是嵌套的ng类),在这种情况下,可能尝试使用不同的黄色(不同的不透明度?)。我还没有尝试过这个想法,因为它不太重要。它呈绿色的原因是因为您已将不透明度设置为
0.40
,因此输入后面的一些蓝色背景正在渗出。蓝色加黄色等于绿色,所以它是绿色的。将不透明度设置为
1
instead@Naomi像上面一样-将不透明度0.40更改为1,颜色不会改变,但这是我的用户故事的要求。我们想要不透明度0.40。我正在考虑为突出显示的黄色添加一个额外的类…我喜欢你最后的建议,并将尝试一下。我在考虑(并开始研究)基于一些复杂的嵌套条件应用多个ng类,但如果我能按照您的建议使用css,听起来会更好更容易-非常感谢。顺便说一句,我现在才看到你的答案。我尝试了你的解决方案,但它对我不起作用。我正在向帖子中添加详细信息-也许你会看到我做错了什么?删除
!来自
smOrange
smYellow
规则的重要声明。这些命令告诉浏览器覆盖其他规则。你不希望在这种情况下,你希望层叠发生有趣的事情,我也在考虑,现在就去试试,谢谢。:)现在原始的黄色看起来不像是黄色,当记录没有突出显示时,橙色看起来像黄色:)