Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Style HTML select tag on ios/safari/iPhone

I have three dropdown lists (three <select> elements). I styled them with the css:

.dropdown{
    font-size: 20px;
    background: white;
    border:none;
    position: relative;
}

In chrome they look perfectly fine. However when I test the site on my iPhone 6s (ios 10.2.1) on Safari the result is a bit different as shown in the image: enter image description here

As you can see there's that gradient in background and near the arrow the background is black.

How can I style the <select> elements so I would have background white on ios either?

like image 479
snecserc Avatar asked Feb 10 '17 11:02

snecserc


1 Answers

Try adding this CSS to disable Ios' default styling:

-webkit-appearance: none;

This will also work on other elements that get special styling, like input[type=search].

like image 174
Stian Martinsen Avatar answered Sep 25 '22 23:09

Stian Martinsen