Reputation: 2686
I got a form in Django but when I use {{ form.as_p }}
it is not exactly what I am expecting.
How can I add a line break between the label and the input text area?
Thanks in advance.
Upvotes: 3
Views: 1483
Reputation: 1230
css:
<style type="text/css">
label{
margin-right: 5em; /* or larger if you need */
}
</style>
django template html file:
{% for field in form %}
<p>{{ field.label_tag }} {{ field }}</p>
{% endfor %}
from Customizing the form template
Upvotes: 5