White background in select box when viewing in Chrome

后端 未结 4 539
温柔的废话
温柔的废话 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条回答
  •  日久生厌
    2021-01-19 06:18

    Google Chrome doesn't support a background image on a select, which is why the rule in the stylesheet breaks.

    To fix it you will need to specifiy the background color and background image separately, so that browsers that don't support the background image will not ignore the entire rule but will at least pick up the rules they do support:

    .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {
      background-color: #E69700;
      background-image: url(images/ui-bg_diagonals-thick_20_e69700_40x40.png) 50% 50% repeat;
    }
    

    Alternately, you could just set the background color in the style attribute, but this is not as clean as the other solution:

    
                            
        
    提交评论

提交回复
热议问题