浏览器兼容
1,border边框的兼容性:设置宽度的div不加border,里面再加一层div,然后给里面的加border。
2,initial 关键字用于设置 CSS 属性为它的默认值。IE浏览器不支持initial
3,ie浏览器input输入框里有X号图标一键删除,密码框有眼睛图标。去掉这些图标的方法:
其中 ::-ms-clear 是文本清除按钮,也就是input右方的叉叉 ::-ms-reveal是密码查看按钮,也就密码框右边的小眼睛。
- <style>
- ::-ms-clear, ::-ms-reveal{display: none;}
- </style>
4,有弹出框时禁止滚动条滑动(也适用于禁止手机滑动):
弹出框显示时给body,html添加height:100%;overflow:hidden;
弹出框隐藏时,给body,html设置样式 height:auto;overflow:auto;
$(".box").show(function(){
$("body,html").css({"height":"100%","overflow":"hidden"});
});
5,获取li元素里的内容并赋值给button
var liText=$("li").text();
$("button").text(liText);
6, input [type=search] 搜索框去掉默认边框和旁边的小图标
input[type="search"]{-webkit-appearance:none;}
input::-webkit-search-cancel-button {display: none;}/*去掉默认的取消x号图标*/
7, 滚动条默认的在最底下的位置
$(".vote_scroll").scrollTop( $('.vote_scroll')[0].scrollHeight );
8,高度100%充满全屏
1, <style>
body{height:100%; overflow:hidden; margin:0px; padding:0px;}
.box {height:100%; background:#ff0000; position:absolute; width:100%;}
</style>
<div class="box"></div>
.box{ height:100% }

浙公网安备 33010602011771号