rem.js reset.css 换公司的时候方便找

"use strict";
var win = window;
win.resize = {};

var timer = null;
var rem = 12;
var doc = win.document;
var docEl = doc.documentElement;

/**
* 刷新页面REM值
*/
function refreshRem() {
var width = docEl.getBoundingClientRect().width;
width = width > 768 ? 640 : width;
rem = width / 7.5;
docEl.style.fontSize = rem + 'px';
}

/**
* 页面缩放或重载时刷新REM
*/
win.addEventListener('resize', function() {
clearTimeout(timer);
timer = setTimeout(refreshRem, 300);
}, false);
win.addEventListener('pageshow', function(e) {
if(e.persisted) {
clearTimeout(timer);
timer = setTimeout(refreshRem, 300);
}
}, false);

refreshRem();

/****reset****/
body,div,table,tr,td,th,h1,h2,h3,h4,h5,h6,form,input,button,label,select,textarea,p,u,i,em,ul,ol,li,dl,dd,dt,img,article,aside,details,figcaption,figure,footer,header,menu,nav,section{ margin:0; padding:0;}
img{ border:0 none; vertical-align:middle;100%;}
li{ list-style:none;}
h1,h2,h3,h4,h5,h6{ font-size:100%;font-weight:normal}
em,i,dfn{ font-style:normal;}
table{ border-collapse:collapse; border-spacing:0;100%;}
a, input, select, textarea, area, button{ outline:none; font-family:inherit; font-size:inherit; border:none; background:none; color:inherit;}
a{ text-decoration:none;}
a:hover{text-decoration:none;}
textarea{ overflow:auto; resize:none;}
input[type="button"], input[type="submit"], input[type="reset"]{ cursor:pointer;-webkit-appearance: none;}

html,body{ overflow-x:hidden;}
html{ -webkit-tap-highlight-color: transparent;}
body{font:400 14px/1 microsoft yahei, Tohoma, Arial; color:#333; text-align:left; background:#fff;}
body{font-family: Arial, Helvetica, 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;}
.fl{float:left;}
.fr{float: right;}
.clearfix{zoom:1;}

原文地址:https://www.cnblogs.com/92xcd/p/8523521.html