How to remove the arrow from a select element in Firefox

后端 未结 30 1718
北恋
北恋 2020-11-22 15:58

I\'m trying to style a select element using CSS3. I\'m getting the results I desire in WebKit (Chrome / Safari), but Firefox isn\'t playing nicely (I\'m not ev

30条回答
  •  礼貌的吻别
    2020-11-22 16:48

    Important Update:

    As of Firefox V35 the appearance property now works !!

    From firefox's official release notes on V35:

    Using -moz-appearance with the none value on a combobox now remove the dropdown button (bug 649849).

    So now in order to hide the default arrow - it's as easy as adding the following rules on our select element:

    select {
       -webkit-appearance: none;
       -moz-appearance: none;
       appearance: none;
    }
    

    DEMO

    select {
      margin: 50px;
      border: 1px solid #111;
      background: transparent;
      width: 150px;
      padding: 5px;
      font-size: 16px;
      border: 1px solid #ccc;
      height: 34px;
      -webkit-appearance: none;
      -moz-appearance: none;
      appearance: none;
    }

提交回复
热议问题