Guys i have progressbar:
<div class="progress"><div class="progress-bar" style="width:{{a.49}}%">{{a.49}} %</div> </div>
How can i assign custom color to progress bar based on condititon in CSS ? :
if a.49 < 50 color red
if a.49 > 50 but less than 70 color orange
if a.49 > 70 color green
Would appreciate your help.
What i tried based on answers but cannot get the desured result :
a=50
<div class="progress">
<div class="progress-bar" style="width:{{a}} %; background:{% if a < 50 %}red{% elif a > 70 %} green{% else %}orange{% endif %};">{{a}} % </div></div>
However though it colors inside bar in color based on value in this case orange, however the bar is filled by 10-20% whereas before it used to fill by 50% as the value of {{a}}
like this :
<div class="progress"><div class="progress-bar" style="width:{{a}}% ;
backkground:{% if a < 50 %} red {% elif a > 70 %} green {% else %} orange {% endif %}"> {{a}} %</div> </div>
is this method can be replicable to progress bar?