【问题标题】:How to change font-family of all items of asp dropdownlist?如何更改 asp 下拉列表中所有项目的字体系列?
【发布时间】:2017-10-16 09:38:16
【问题描述】:

我有一个基本的 asp 下拉列表。如何更改下拉列表中所有选项的字体?如果我在 ddl 中添加一个 cssclass ,则所选项目的字体仅更改,但其余项目的字体不更改??

【问题讨论】:

    标签: css asp.net


    【解决方案1】:

    在 Chrome (F12) 中检查元素,看看应用的默认样式是什么?如果没有样式,那么就这样做

    .select { /* style your select */
        font-family: 'Courier New';
    }
    .select option { /* style your options */
        font-family: 'Elephant';
    }
    

    【讨论】:

    • 这不适用于 firefox 但 chrome
    【解决方案2】:

    我找到了这个解决方案。使用下面的 CSS:

     option{
                
                font-family://your font here//;                
                
            }
    

    请记住,此解决方案适用于 Chrome。对于 Firefox,我没有找到任何字体,否则您的字体将位于 Windows\Fonts 目录中。

    【讨论】:

      猜你喜欢
      • 2023-03-20
      • 1970-01-01
      • 2015-03-12
      • 2018-03-12
      • 2012-12-30
      • 2018-12-04
      • 2021-08-26
      • 2022-01-14
      • 1970-01-01
      相关资源
      最近更新 更多