[英]How do I change the font-size of a bootstrap-select drop-down menu?
我试图设置一个单独的CSS类以覆盖下拉菜单的样式。 但是,它不起作用。
#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
}
在DOM中指定类时,请勿使用.
,仅用于在CSS(或jQuery)中访问它。 将'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.