根据django-crispy-form文档,我将能够用类更改输入宽度input-small
.但我的表单看起来宽度为100%:
另外,如果我将css_class添加到Field,则大小保持为宽度:100%(.form-control
)
我已按照文档说明设置表单:
class LoginForm(forms.Form): usuari = forms.CharField( help_text = u'Codi Usuari') paraula_de_pas = forms.CharField( help_text = u'Paraula de pas') # Uni-form helper = FormHelper() helper.form_class = 'form-horizontal' helper.label_class = 'col-lg-2' helper.field_class = 'col-lg-8' helper.layout = Layout( PrependedText('usuari', ' ', css_class='input-small'), PrependedText('paraula_de_pas', ' ', css_class='input-small'), FormActions( Submit('save_changes', 'Entrar-hi', css_class="btn-primary"), ) )
在设置中:
CRISPY_TEMPLATE_PACK="bootstrap3"
我是最新版本.怎么了?