将Python/WTForms/Bootstrap生成的标签和单选按钮保持在同一行
我正在使用Python/Flask WTForms 2.1版和Boostrap 3 CSS,我找不到解决此问题的方法: 在Python表单生成代码中,我有这个表单元素将Python/WTForms/Bootstrap生成的标签和单选按钮保持在同一行,python,twitter-bootstrap-3,wtforms,radiobuttonlist,Python,Twitter Bootstrap 3,Wtforms,Radiobuttonlist,我正在使用Python/Flask WTForms 2.1版和Boostrap 3 CSS,我找不到解决此问题的方法: 在Python表单生成代码中,我有这个表单元素 searchtype = RadioField("Search type:", choices=[('any', 'Any names'), ('all', 'All names')]) 在我的烧瓶模板里 <!-- radiobutton for search type --> {{form.searchtype.
searchtype = RadioField("Search type:", choices=[('any', 'Any names'), ('all', 'All names')])
在我的烧瓶模板里
<!-- radiobutton for search type -->
{{form.searchtype.label}}{{form.searchtype(class_="list-inline")}}
{{form.searchtype.label}{{form.searchtype(class=“list inline”)}
单选按钮是通过“list inline”内联正确生成的,但是在标签元素之后有一个换行符,我想删除它。但是,我找不到任何类或样式可以添加到form.searchtype.label或form.searchtype,这将使单选按钮在元素后的同一行上运行
生成的HTML:
<label for="searchtype">Search type:</label>
<ul class="list-inline" id="searchtype">
<li><input id="searchtype-0" name="searchtype" type="radio" value="any">
<label for="searchtype-0">Any names</label></li>
<li><input id="searchtype-1" name="searchtype" type="radio" value="all">
<label for="searchtype-1">All names</label></li></ul>
搜索类型:
-
有名字吗
-
所有名称
提前谢谢