比如:
根据
<ul style="float: left;overflow:hidden;" ng-repeat='node in nodedata' >
<li style="list-style-type:none;">
<span style="background:green;" uib-popover="{{node.nodeIndex|getNodeNameFliter}}" popover-trigger="mouseenter" type="button" class="btn btn-default dd breath_light" popover-placement="bottom">{{node.nodeIndex|getNodeNameFliter}}</span> <i class="icon-chevron-right" style="margin-left:10px;color:green;font-size:20px;"></i>
</li>
</ul>
style="background:green;"`可以根据 node.status不同的值1,2,3,4设置red,yellow,green,black如何实现呢?
在线等,没人会吗?
html code: using ng-style
js code:
As far as I know, CSS does not have such a function. The most famous CSS is media query, which can select different CSS styles according to different screen sizes. I think a request like the one in question can only be realized with the cooperation of JS.
Now there are actually some people who use inline styles
That’s what I would do
<style>
.backstyel1{background:red}
.backstyel2{background:yellow}
.backstyel3{background:green}
.backstyel4{background:black }
</style>