簡體   English   中英

如何更改引導選擇下拉菜單的字體大小?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM