1、如果你用edge这个浏览器打开你的页面时,浏览器会把电话、邮箱、住址高亮显示,不管那你设置什么样式都改变不了,只要加上下面这段话就可以解决。
<meta name="format-detection" content="telephone=no,email=no,adress=no">
2、遇到 IE 浏览器,一定要加上下面这段话,让 IE 以最高版本的文档模式渲染页面,打个比方你的浏览器已经升级到了ie9,然而你的文档模式还是ie8。
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
3、用IE打开网站时,input框最后,总会有叉叉和小眼睛的图标,为了保证每个浏览器显示的效果一致,要去除IE中input框中叉叉和小眼睛的图标。
<style>
::-ms-clear, ::-ms-reveal{display: none;}
</style>
4、谷歌中,当输入用户名和密码时,背景会变成黄色,去除的方法:
input{
-webkit-box-shadow: 0 0 0 1000px white inset;
}
5、IE8中,input的设置高度时,IE8中的字体不局中,所以设置高度的时候一定要要设置行高,
与高度的值大小相等,例如:
style{
height:40px;
line-height:40px;
}
6、input框的提示问题
(1)第一种算是比较简单的,但是当input中value的值作为查询条件时,就不能使用了
<input type="text" value="我是默认值" onblur="if(this.value==''){ this.value='我是默认值}"
onfocus="if(this.value=='我是默认值'){this.value=''}">
( 2 )第二种就是用插件解决了,兼容性比较好,使用起来很方便。
http://www.bootcdn.cn/jquery-placeholder/
7、禁止用户用滚轮缩放
<script language="javascript">
var scrollFunc=function(e){
e=e || window.event;
if(e.wheelDelta && event.ctrlKey){//IE/Opera/Chrome
event.returnValue=false;
}else if(e.detail){//Firefox
event.returnValue=false;
}
}
/*注册事件*/
if(document.addEventListener){
document.addEventListener('DOMMouseScroll',scrollFunc,false);
}//W3C
window.onmousewheel=document.onmousewheel=scrollFunc;//IE/Opera/Chrome/Safari
</script>