I have been customizing Django form fields using this helpful guide.
Here is the form structure:
class contact(forms.Form):
first_name = forms.CharField()
middle_name = forms.CharField()
last_name = forms.CharField()
This is how the template looks:
<form action="/contact/" method="post">
{% include "form_snippet.html" %}
<p><input type="submit" value="Send message" /></p>
</form>
In the form_snippet.html file:
{% for field in form %}
<div class="fieldWrapper">
{{ field.errors }}
{{ field.label_tag }}: {{ field }}
</div>
{% endfor %}
In the CSS stylesheet:
.fieldWrapper{
font-size: 10px;
color: #f00;
font-family: verdana, tahoma, serif;
white-space:nowrap;
}
After running the server, each form field is displayed on a new line.
I would like to have all three form fields appear on the same line instead of each being on a separate line.
Any suggestions on achieving this layout?