White background in select box when viewing in Chrome

后端 未结 4 538
温柔的废话
温柔的废话 2021-01-19 05:37

this html only in chrome makes the selected value non visible, the bacground of the select in other browsers is colored, only in chrome it\'s white



        
4条回答
  •  萌比男神i
    2021-01-19 06:30

    I know this is a little old but I ran onto it when looking for the the same anwser and the is a Css way to fix this

    @media screen and (-webkit-min-device-pixel-ratio:0) { // target only -webkit browsers

    select {
        background-image: none; /* remove the value that chrome dose not use */
        background-color: #333; /* set the value it does */
        border-radius: 4px;     /* make it look kinda like the background image */
        border: 1px solid #888;
    }
    

    }

    Hope that it helps

提交回复
热议问题