How to remove the arrow from a select element in Firefox

后端 未结 30 1713
北恋
北恋 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:42

    Jordan Young's answer is the best. But if you can't or don't want to change your HTML, you might consider just removing the custom down arrow served to Chrome, Safari, etc and leaving firefox's default arrow - but without double arrows resulting. Not ideal, but a good quick fix that doesn't add any HTML and doesn't compromise your custom look in other browsers.

    
    

    CSS:

    select {
       background-image: url('images/select_arrow.gif');
       background-repeat: no-repeat;
       background-position: right center;
       padding-right: 20px;
    }
    
    @-moz-document url-prefix() {
      select {
        background-image: none;
      }
    }
    

提交回复
热议问题