简体   繁体   English

如何更改引导选择下拉菜单的字体大小?

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

相关问题 我将如何使用Selenium选择下拉菜单 - How would I use Selenium to select a drop-down menu 如何使用硒从下拉菜单中随机选择? - How to randomly select from a drop-down menu using selenium? 如何使用 Selenium、Python 选择下拉菜单值 - How to select a drop-down menu value with Selenium, Python 如何使用 Python 与 Selenium 一起 select 下拉菜单值? - How to select a drop-down menu value with Selenium using Python? 我如何使用下拉菜单来抓取网页? (使用硒) - How do i XPATH or CSS scrape a Web-Page by utilizing the drop-down menu? (Using Selenium) 如何从 .kv 文件中添加在 .py 文件中制作的 Kivy 下拉菜单? - How do I add a Kivy drop-down menu made in the .py file from the .kv file? 如何使下拉菜单可滚动 - How to make a drop-down menu scrollable PyGTK:从上一个组合框下拉菜单更改组合框下拉菜单 - PyGTK: Change combobox drop-down menu from a previous combobox drop-down menu 如何使用 select 这个非 select 下拉菜单中的元素使用 Selenium Webdriver 和 ZA7F57F35426B9387411 - How to select this element from this non select drop-down menu using Selenium Webdriver and Python Python Selenium select 如何从单个 select 下拉菜单中的一个项目,当有多个? - With Python Selenium, how to select an item from a single select drop-down menu, when there are multiple?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM