停止自动样式输入type = search的chrome [英] Stop chrome from auto styling input type=search

查看:268
本文介绍了停止自动样式输入type = search的chrome的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否仍有阻止Chrome对输入类型=搜索进行样式化。当一个输入类型= text 时,我可以设置输入的样式,虽然一旦我把它改为HTML5搜索,我就把所有的样式应用于输入。

Is there anyway to prevent Chrome from styling the input type=search. I can style the input fine when it is a input type=text although once I change this to a HTML5 search it boxs all styles I have applied to the input.

Type = text

Type = search

更新具有重置属性的答案

Updated answer with reset properties

input[type="search"] {
    -webkit-appearance: textfield;
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration  {
    -webkit-appearance: none;
}


推荐答案

p>

You could try:

input[type="search"] {
    -webkit-appearance: textfield;
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

是否有帮助?

这篇关于停止自动样式输入type = search的chrome的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆