S
S
Sergey Nizhny Novgorod2016-06-27 17:32:28
Django
Sergey Nizhny Novgorod, 2016-06-27 17:32:28

How to change css style in Django?

Hello.
I'm doing a survey in the article. Faced with the fact that I don’t know how to assign the length of the strip of answers.
%25D0%259A%25D0%25B0%25D0%25BA%2B%25D0%2
The number of answers is stored in the questionnaire model, the percentages of the total are derived by the methods of the model. But the length of the strip is currently set by the style (width : 20px). And I don't know how to be here.
Option 1: create 100 styles with different length parameters and output the required class (style) through the model method.
Option 2: Using jquery, take the percentage variable, and climb into the css class and change the style width.
Option 3: ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2016-06-27
@Terras

<div style="{{ my.percents }}">
<div style="width:12.3%">

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question