Lucas Rezende
Lucas Rezende

Reputation: 2686

Customize form brought from Django forms.py

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

Answers (1)

sefakilic
sefakilic

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

Related Questions