-
placeholder
IE10以下不支持placeholder属性,若要,可参考文章IE兼容placeholder
placeholder样式修改
::-moz-placeholder{color:red;} //Firefox
::-webkit-input-placeholder{color:red;} //Chrome,Safari
:-ms-input-placeholder{color:red;} //IE10
-
input
(1)IE9+会对input[type=text],默认出现一个“×”;input[type=password]也会出现一个眼睛图标,样式可去除。::-ms-clear
是清除按钮,::-ms-reveal
是密码小眼睛。
::-ms-clear, ::-ms-reveal {
display:none;
}
PS:Chrome的搜索输入框默认的搜索“×”为::-webkit-search-cancel-button
::-webkit-search-cancel-button {
display: none;
}
(2)search

<input type="search">当输入数据时会出现取消按钮,可以通过以下代码进行清除
/* 清除input默认clear */
::-webkit-search-cancel-button {
display: none;
}
::-ms-clear {
display: none;
}
PS:该方法不是规范的,目前只支持webkit和blink内核的,需要添加私有前缀。
网友评论