现在的位置: 首页 > 综合 > 正文

rest.css文件

2018年01月28日 ⁄ 综合 ⁄ 共 3352字 ⁄ 字号 评论关闭

//  移动端在重置样式之前把:

<meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="format-detection" content="telephone=no,email=no"> <!---不给电话邮箱加链接--->
加入<head/>

/*------------------------------------reset css for mobile---------------------------*/

html{ font-size: 62.5%;  /* 10 ÷ 16 × 100% = 62.5% */ }
html, body { 

            -webkit-user-select: none;   /* 禁止选中文本(如无文本选中需求,此为必选项) */
             user-select: none;             

        }      

a, img { -webkit-touch-callout:
none; /* 禁止长按链接与图片弹出菜单 */
}

        body,input,select,button{
           font:1.2rem normal "Helvetica Neue", Helvetica, STHeiTi, sans-serif;
        }
        h1 { font-size: 1.8rem; /* 18px / 12px = 1.5 */ }
        h2 { font-size: 1.6rem; }
        h3 { font-size: 1.4rem; }
        h4, h5, h6 { font-size: 100%; }
        address, cite, dfn, em, var { font-style: normal; } /* 将斜体扶正 */
        code, kbd, pre, samp, tt { font-family: "Courier New", Courier, monospace; } /* 统一等宽字体 */
        small { font-size: 1rem; } /* 小于 12px 的中文很难阅读,让 small 正常化 */

        body, h1, h2, h3, h4, h5, h6, hr, p, blockquote,
        dl, dt, dd, ul, ol, li, pre, /* text formatting elements 文本格式元素 */
        fieldset, lengend, button, input, textarea, /* form elements 表单元素 */
        th, td { margin:0;padding:0;}
        input,button,select,img{margin:0;line-height:normal}
        select{padding:1px}
        ul,ol{list-style:none}
        select,input,button,button img,label{vertical-align:middle}
        header,footer,section,aside,nav,hgroup,figure,figcaption{display:block;margin:0;padding:0;border:none;} /*HTML5标签变块级*/
        a{text-decoration:none;} /*重置链接下划线*/
        img {max-width: 100%;height: auto; border:none;}
  

        /* 浮动及边常用边距  */
        .fL{float:left;}
        .fR{float:right;}
        .mL10{margin-left:10px;}
        .mB10{margin-bottom:10px;}

        /*清除浮动*/
        .clear{clear:both;}
        .clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden}
        .clearfix{display:inline-block}
        * html .clearfix{height:1%} /* Hides from IE-mac \*/
        .clearfix{display:block}/* End hide from IE-mac */



/*----------------------reset css for PC------------------------------------*/ 

        body,input,select,button{
            /*font: 12px/1 Tahoma, Helvetica, Arial, "宋体", sans-serif;*/
            font: 12px/1 Tahoma, Helvetica, Arial, "\5b8b\4f53", sans-serif; /* 用 ascii 字符表示,使得在任何编码下都无问题 for PC端 */
        }

        body{font-size:12px;line-height:166.6%;}  /*pc端常设置字体大小及间距*/
        h1 { font-size: 18px; /* 18px / 12px = 1.5 */ }
        h2 { font-size: 16px; }
        h3 { font-size: 14px; }
        h4, h5, h6 { font-size: 100%; }
        address, cite, dfn, em, var { font-style: normal; } /* 将斜体扶正 */
        code, kbd, pre, samp, tt { font-family: "Courier New", Courier, monospace; } /* 统一等宽字体 */
        small { font-size: 12px; } /* 小于 12px 的中文很难阅读,让 small 正常化 */

        body, h1, h2, h3, h4, h5, h6, hr, p, blockquote,
        dl, dt, dd, ul, ol, li, pre, /* text formatting elements 文本格式元素 */
        fieldset, lengend, button, input, textarea, /* form elements 表单元素 */
        th, td { margin:0;padding:0;}
        input,button,select,img{margin:0;line-height:normal}
        select{padding:1px}
        ul,ol{list-style:none}
        select,input,button,button img,label{vertical-align:middle}
        header,footer,section,aside,nav,hgroup,figure,figcaption{display:block;margin:0;padding:0;border:none;} /*HTML5标签变块级*/
        a{text-decoration:none;} /*重置链接下划线*/
        img{border:none;}

        /* 浮动及边常用边距  */
        .fL{float:left;}
        .fR{float:right;}
        .mL10{margin-left:10px;}
        .mB10{margin-bottom:10px;}

        /*清除浮动*/
        .clear{clear:both;}
        .clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden}
        .clearfix{display:inline-block}
        * html .clearfix{height:1%} /* Hides from IE-mac \*/
        .clearfix{display:block}/* End hide from IE-mac */

【上篇】
【下篇】

抱歉!评论已关闭.