html5 search input does not work with bootstrap

后端 未结 5 1130
既然无缘
既然无缘 2020-12-09 02:12

I have tested the input[type=\"search\"] and it does not show the clear (x) icon when the bootstrap styles have been applied.

5条回答
  •  借酒劲吻你
    2020-12-09 02:44

    input[type="search"] {
     -webkit-box-sizing: content-box;
     -moz-box-sizing: content-box;
     box-sizing: content-box;
     -webkit-appearance: searchfield;
    }
    
    input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: searchfield-cancel-button;
    }
    

    works for me on Chrome (on my Mac, but not on my iPhone...)

提交回复
热议问题