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

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

作者: duziten | 来源:发表于2017-11-08 13:47 被阅读0次

    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%;
    
    }
    

    相关文章

      网友评论

          本文标题:移动端web页面模板,和css重置文件

          本文链接:https://www.haomeiwen.com/subject/tgnemxtx.html