简体   繁体   中英

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. 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 . , only for accessing it in CSS (or jQuery). change 'selectpicker .selectStyle' to 'selectpicker selectStyle' , that should do the trick.

fund = forms.ChoiceField(choices=FUND, required=True, widget=forms.Select(attrs={'class': 'selectpicker selectStyle'}))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM