问题
我想访问跨度文本并更改其颜色。 我如何在以下设置中执行此操作?
代码
<div class="element">
<button type="button" class="btn btn-default">
<span class="glyphicon glyphicon-play" ng-if="true">button</span>
</button>
<span class="title">Change this color</span>
</div>
建议
span.glyphicon.glyphicon-play[ng-if="true"] span.title {
color:red;
}
不幸的是,这不起作用。
JSFiddle
最佳答案
试试这个:
span.glyphicon.glyphicon-play[ng-if="true"], span.title {
color:red;
}
关于css - 更改嵌套跨度之外的跨度元素的属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26010400/