1. CSS工具:重置CSS样式
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
来源声明 : meyerweb.com/eric/tools/…
2. 移动端CSS样式初始化
@import url("https://cdn.bootcss.com/normalize/8.0.1/normalize.min.css");
html, body, h1, h2, h3, h4, h5, h6, div, dl, dt, dd, ul, ol, li, p, blockquote, pre, hr, figure, table, caption, th, td, form, fieldset, legend, input, button, textarea, menu { margin: 0; padding: 0; }
html, body { width: 100%; height: 100%;}
html {font-size: 62.5%;}
body {font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif; font-size: 1.4rem; background-color: #fff; position: relative;}
ul li {list-style-type: none;}
*, *:after, *:before { box-sizing: border-box;}
a { text-decoration: none;}
*:focus {outline: none;}
* { touch-action: pan-y; -webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}
.clear-fix{zoom:1;}
.clear-fix::after{clear: both;content: '';display: block;width: 0;height: 0;visibility: hidden;}
/* :root 获取根元素html(颜色样式自定义) */
:root {
--color-text:#666;
--color-high-text:#ff5777;
--color-tint:#ff8198;
--color-background:#fff;
--font-size:14px;
--line-hight:1.5;
}