Text size for drop down menu/input select not working in Safari

后端 未结 12 1567
说谎
说谎 2021-02-19 00:17

First question...

I\'m having trouble getting ANY of the Drop down menu/Input Select\'s to appear with size 18 font in Safari.

Works fine in FF.

Code:

相关标签:
12条回答
  • 2021-02-19 00:35

    You can target Safari select tag by doing this:

    select {
        width: 224px;
        line-height: 1.8;  (This can be in px too)
    }
    
    0 讨论(0)
  • 2021-02-19 00:36

    In some cases it can help:

    select {
        -webkit-appearance: menulist-button;
        font-size: 30px;
    }
    
    0 讨论(0)
  • 2021-02-19 00:37

    I figured out a way that safari will pick up on font-size ... all you need to do is set a border color, like the following.

    -webkit-appearance: none; will make you lose all of safari's attributes, like the arrows... below you can increase the size without losing that.

    Will Work in Safari

    <select style=" font-size: 3em; border: black;">
        <option>TEXT</option>
    </select>
    

    Won't Work in Safari

    <select style=" font-size: 3em;">
        <option>TEXT</option>
    </select>
    
    0 讨论(0)
  • 2021-02-19 00:40

    To style a select in Safari you first have to turn off the os styling:

    select {
        -webkit-appearance: none;
    }
    
    0 讨论(0)
  • 2021-02-19 00:42

    At least in Safari 5.1 (I don't have 3 running anymore) you can turn off the default styling with:

    select{-webkit-appearance: none}
    

    Then it will conform to your font sizing.

    0 讨论(0)
  • 2021-02-19 00:46

    Setting line-height:100% will constrain the height of the select box for a more consistent look, but it still doesn't affect the actual font size.

    0 讨论(0)
提交回复
热议问题