Skip to content Skip to sidebar Skip to footer

Change HTML With Variables In Django

I have the dict latest_status: {'What': 10, 'Study'': 10, 'all': 10, 'to': 10, 'facebook'': 10, 'has': 10, 'worth': 20, 'hurting': 10 } I am trying to make a text cloud by doing s

Solution 1:

The <style> tag is used to introduce a block (or external resource) containing style definitions. You'll want to encapsulate your text in a presentation tag of some sort--for example:

{% for word,count in latest_status.items %}
<p style="font-size:{{ count }}px;"> {{ word }}</p>
{% endfor %}

Post a Comment for "Change HTML With Variables In Django"