默认情况下,<input type="search" />
呈现类似于 Mac OS X 上的“本机”搜索字段(圆角、清除按钮等)。我想完全删除此自定义样式,以便输入看起来与等效的文本输入相同(<input type="text" />
),但同时保持输入类型设置为search
.
我试过了-webkit-appearance: none;
,这使它非常接近...但是我似乎无法覆盖边距/填充,这会导致搜索字段的宽度呈现比文本输入短约 20px 的有趣现象。
还有吗-webkit-
我不知道完全禁用样式的特定属性?
尝试这些样式:
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;
}
Source: http://css-tricks.com/webkit-html5-search-inputs/#comment-82432 http://css-tricks.com/webkit-html5-search-inputs/#comment-82432
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)