如何阻止 Safari 将放大镜图像放入我的 <input type="search"> 字段中?

tes*_*dtv 2 html javascript css safari

我有一个文本框(搜索框),编码如下

<input type="search" id="searchKeywords" name="searchKeywords" value="" maxlength="50">
Run Code Online (Sandbox Code Playgroud)

同样的情况在 Safari 中看起来不太好:它有一个背景图像。

但据我所知,主要问题是由于某些默认样式:

-webkit-appearance: searchfield;
Run Code Online (Sandbox Code Playgroud)

我使用 Safari 开发者工具发现了这一点。

我怎样才能覆盖相同的内容?

我已经尝试过使用;

-webkit-appearance:none;
Run Code Online (Sandbox Code Playgroud)

!important并使用...

但似乎并没有被覆盖。

请帮我。谢谢。

LeR*_*Roy 7

您应该查看http://Formalize.me,它是一个很棒的小包,可以操作和标准化表单对象。话虽这么说,它看起来像使用:

input[type=search] { -webkit-appearance: none; }
Run Code Online (Sandbox Code Playgroud)