Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/algorithm/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
如何在CSS中嵌套if/then_Css - Fatal编程技术网

如何在CSS中嵌套if/then

如何在CSS中嵌套if/then,css,Css,初学者问题。我有这个代码,很好用 /* Start attribute labels bold */ .custom-attributes .attribute-label { font-weight: bold; } /*End attribute labels bold */ /* Start attribute value color */ .custom-attributes .attribute-value { color: red; } /* End attribu

初学者问题。我有这个代码,很好用

/* Start attribute labels bold */
.custom-attributes .attribute-label {
    font-weight: bold;
}
/*End attribute labels bold */

/* Start attribute value color */
.custom-attributes .attribute-value {
    color: red;
}
/* End attribute value color  */
现在,我想筛选.custom attributes.attribute标签并查找值1,然后将所有.custom attributes.attribute值打印到此标签上。所以基本上

我希望这是可以理解的。。。我该怎么做


这是为wordpress网站定制的输出。

重申您的问题。这没有道理。CSS没有任何if语句的概念。此外,“查找值”和“打印”是什么意思?您必须根据条件通过Javascript更改css。你不能通过css来完成它。。。这是如果我正确理解了你的问题。属性、类、id、树中的位置可以通过CSS进行调整,这就是选择器的用途。如果
选择器匹配,则它已经相似如果该选择器也匹配,则执行
。。。这里没有您的HTML来显示您尝试为特定样式选择的内容。如果你澄清你的问题,那么我们可能会帮助你,谢谢你。我正在寻找这样的东西:if.custom attributes.attribute label=1然后是custom attributes.attribute value{color:red;}if.custom attributes.attribute label=2然后是custom attributes.attribute value{color:green;}你的答案在这里:)我没有跟随你的链接。显示您的问题的html和css应该在这里的问题中。链接可以被破坏或修改,并且问题对于其他有类似问题的用户来说是无用的。