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 %}
从自定义表单模板