【发布时间】:2012-07-17 07:13:07
【问题描述】:
有没有办法阻止 Chrome 设置 input type=search 的样式。当它是input type=text 时,我可以很好地设置输入的样式,尽管一旦我将其更改为 HTML5 搜索,它会框住我应用于输入的所有样式。
类型 = 文本
类型 = 搜索
使用重置属性更新答案
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;
}
【问题讨论】:
-
刚刚上传的图片显示了我的意思
标签: css google-chrome