移动端web页面模板,和css重置文件

2017-11-08  本文已影响0人  duziten

1.设置网页跟字体大小

(function(){

var html=document.documentElement;

var hWidth=html.getBoundingClientRect().width;

html.style.fontSize=hWidth/数字+'px';

}())

2.重置移动端相关默认样式

a,

input,

button {

-webkit-tap-highlight-color: rgba(0, 0, 0, 0);

}

h1 {

margin: 0;

padding: 0;

}

a {

text-decoration: none;

}

input,

button {

-webkit-apperance: none;

border-radius: 0;

}

body {

margin: 0;

-webkit-user-select: none;

-webkit-text-size-adjust: 100%;

}

body * {

-webkit-user-select: none;

font-family: Helvetica;

}

ul {

margin: 0;

padding: 0;

list-style: none;

}

img {

vertical-align: top;

}

body,

html {

height: 100%;

width: 100%;

}
上一篇下一篇

猜你喜欢

热点阅读