[英]How do I change the font-size of a bootstrap-select drop-down menu?
I tried to set a separate css class to overide the style of the dropdown menu. 我试图设置一个单独的CSS类以覆盖下拉菜单的样式。 However, it's not working.
但是,它不起作用。
#form.py
class fundForm(forms.Form):
fund = forms.ChoiceField(choices=FUND, required=True, widget=forms.Select(attrs={'class': 'selectpicker .selectStyle'}))
class META:
model = fundList
#html
.selectStyle{
font-size: 5px
}
when you specify a class in the DOM, you do not use the .
在DOM中指定类时,请勿使用
.
, only for accessing it in CSS (or jQuery). ,仅用于在CSS(或jQuery)中访问它。 change
'selectpicker .selectStyle'
to 'selectpicker selectStyle'
, that should do the trick. 将
'selectpicker .selectStyle'
更改为'selectpicker selectStyle'
,可以解决问题。
fund = forms.ChoiceField(choices=FUND, required=True, widget=forms.Select(attrs={'class': 'selectpicker selectStyle'}))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.