【发布时间】:2017-07-20 16:44:25
【问题描述】:
我想在同一行显示两个表单域,而不是一个接一个。
目前,我得到:
Choice a theme :
. Datasystems
. Cameroun
但我想这样显示这个表单:
Choice a theme:
. Datasystems . Cameroun
我的 .html 文件看起来像:
{% extends 'Base_Configurations.html' %}
{% load staticfiles %}
{% load static %}
{% block title %}
<h3> <span class="glyphicon glyphicon-file"></span> Choix du thème DatasystemsEC </align> </h3>
{% endblock %}
{% block content %}
<form class="form" method='POST' action=''> {% csrf_token %}
<br></br>
{{ form }}
<br></br>
<input class="button" type="submit" value="Valider le thème" />
</form>
{% endblock %}
我还有一个 .css 文件:
.form-fields {
border-radius: 4px;
margin-right: auto;
width:50%;
background-color: #f5f5f5;
}
.form {
padding-left:8vw;
}
label {
width: 35%;
border-radius: 8px;
margin-bottom: -20px;
list-style: none;
}
目前,我找不到解决问题的方法。我查看了一些教程或 StackOverflow 问题,但目前还没有。
你对这个处理有什么想法吗?
【问题讨论】:
-
如果你想使用 bootstrap,那么我有一个简单的解决方案给你。
-
@PrakharTrivedi 谢谢你的回答。我在 10 秒前刚刚找到了解决方案。我要编辑一个答案。但我想听听你的解决方案;)
标签: python html css django django-templates