Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Djangoでフォームを取得しましたが、使用{{ form.as_p }}すると、期待したものとは異なります。
{{ form.as_p }}
ラベルと入力テキスト領域の間に改行を追加するにはどうすればよいですか?
前もって感謝します。
CSS:
<style type="text/css"> label{ margin-right: 5em; /* or larger if you need */ } </style>
django テンプレート html ファイル:
{% for field in form %} <p>{{ field.label_tag }} {{ field }}</p> {% endfor %}
フォーム テンプレートのカスタマイズから