【发布时间】:2016-06-05 15:24:33
【问题描述】:
<input type="search">
所有在线文章都表明input 和type=search 将在输入的右侧有一个清除按钮(在Apple 产品上)。
这在 MacOS 上的 Safari 中仍然有效,但在移动 safari (iOS9) 中不再有效。
有没有办法恢复这个搜索取消按钮?
我已经试过了:
input::-webkit-search-cancel-button{-webkit-appearance:searchfield-cancel-button;}
我还尝试为输入提供name 和value。也将其放在form 中,但无济于事。
我找到了page that added the button using css,但在我的 iPhone 上,按下按钮会将小方块放在按钮内,这非常奇怪,而且无法使用。
【问题讨论】: