treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Any advice on removing dropdown in CSS for Firefox? [URL Included]

  • Hey there guys,

    I've been battling this dropdown recently for Firefox and I'm desprately trying to find a solution to remove this default dropdown in Firefox so, I can use my custom arrow. It's developed with foundation, so solutions with a static width/height, etc to hide it from the form doesn't really work out in my case and I'm trying to avoid from JS plugins to depend on this form.

    It's even more of a bummer that I know a solution that should work, but Firefox hasn't fixed this issue since early 2011 with the '-moz-apperance: none;' as it doesn't do anything which was supposed to work just like -webkit-apperance: none; which eliminates the default dropdown as intended.

    Here is the test site, I'm working with: http://bit.ly/YoqW8r

    Much appreciated everyone!

  • Hi DoPeT!

    Try either of these solutions (from this StackOverflow answer); but first you'll need to wrap the narrower selects inside of a "fivesix" element instead of applying that class directly to the select:

    .eight, .fivesix {
        overflow: hidden;
    }
    select {
        width: 120%;
        background: url("../images/select.png") no-repeat scroll 90% center #F2F2F2;
    }
    

    Alternatively, you could use text-indent to push the arrow out of view... and push your text to the right as well:

    .eight, .fivesix {
        overflow: hidden;
    }
    select {
        text-indent: 50px; /* you'll need 50px in your case */
    }
    
  • Another option is to wrap the select in a div and style that instead of the select, as this tutorial demonstrates: http://bavotasan.com/2011/style-select-box-using-only-css/

  • @Mottie Hey thanks!! Pretty helpful, as your second alternative actually worked out pretty well except obviously the text indent. Is there any way of 'forcing' the text back without the dropdown as well? Starting to look a lot better!

    I've actually tried the third option before and seemed to not do the trick, however could've been my fault. I'm going to try that again as well!

    Again, I appreciate for taking your time to review my markup like that and everything!

  • If anyone has any suggestions to help improve this, would be very appreciated!