Answer the question
In order to leave comments, you need to log in
How to pass parameter received from view to css?
Good afternoon!
When a list of parameters is passed to the template, the value of one of the parameters must be passed as the width of the element. I am using django1.5 and bootstrap2.3.
For example, there is such a block:
<div class="progress">
<div class="bar bar-success" style="width: 20%;"></div>
<div class="bar bar-danger" style="width: 80%;"></div>
</div>
<div class="progress">
<div class="bar bar-success" style="width: {{ value }}%;"></div>
<div class="bar bar-danger" style="width: 100-{{ value }}%;"></div>
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question