Answer the question
In order to leave comments, you need to log in
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.
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question