处理响应式布局
//公共部分
a,input{-webkit-tap-highlight-color:transparent;text-decoration:none;}
input[type="button"], input[type="text"], input[type="email"], input[type="search"], input[type="password"] {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
outline:none;
}
input[type="text"], input[type="email"], input[type="search"], input[type="password"] {
border:1px solid #dedede;
}
input[type="button"]{
background:none;
border:none;
text-align:center;
}
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, figcaption, figure, footer, header, hgroup, menu, nav, section, summary,
time, mark, audio, video, input {
margin: 0;
padding: 0;
border: none;
outline: 0;
font: inherit;
font-size:100%;
vertical-align: baseline;
}
html, body, form, fieldset, p, div, h1, h2, h3, h4, h5, h6 {
-webkit-text-size-adjust: none;
}
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
display: block;
}
body {
font-family: arial, sans-serif;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after, q:before, q:after {
content: '';
content: none;
}
ins {
text-decoration: none;
}
del {
text-decoration: line-through;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
* {
-webkit-touch-callout:none;
-webkit-user-select:none;
-khtml-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
}
input {
-webkit-touch-callout:auto;
-webkit-user-select:auto;
-khtml-user-select:auto;
-moz-user-select:auto;
-ms-user-select:auto;
user-select:auto;
}
/*公共media query查询 1rem初始设置为12px
dpr为2时对应750的效果图 dpr为3时对应1080的效果图
查询区间间隔暂时设置为30px 对应3倍图时 1rem大小变化1px
对于dpr为2的有额外百分之4.2增大的兼容*/
@media screen and (max-width: 320px) {
html,body{font-size:62.5%}
}
@media screen and (min-width: 321px) and (max-width:350px) {
@media screen and (-webkit-min-device-pixel-ratio: 2){
html,body{font-size:71.62%}
}
@media screen and (-webkit-min-device-pixel-ratio: 3){
html,body{font-size:68.75%}
}
}
@media screen and (min-width: 351px) and (max-width:380px) {
html,body{font-size:75%}
}
@media screen and (min-width: 381px) and (max-width:410px) {
@media screen and (-webkit-min-device-pixel-ratio: 2){
html,body{font-size:84.64%}
}
@media screen and (-webkit-min-device-pixel-ratio: 3){
html,body{font-size:81.25%}
}
}
@media screen and (min-width: 411px) and (max-width:440px) {
@media screen and (-webkit-min-device-pixel-ratio: 2){
html,body{font-size:91.15%}
}
@media screen and (-webkit-min-device-pixel-ratio: 3){
html,body{font-size:87.5%}
}
}
@media screen and (min-width: 441px) and (max-width:470px) {
@media screen and (-webkit-min-device-pixel-ratio: 2){
html,body{font-size:97.66%}
}
@media screen and (-webkit-min-device-pixel-ratio: 3){
html,body{font-size:93.75%}
}
}
@media screen and (min-width: 471px) and (max-width:500px) {
@media screen and (-webkit-min-device-pixel-ratio: 2){
html,body{font-size:104.17%}
}
@media screen and (-webkit-min-device-pixel-ratio: 3){
html,body{font-size:100%}
}
}
@media screen and (min-width: 501px) and (max-width:539px) {
@media screen and (-webkit-min-device-pixel-ratio: 2){
html,body{font-size:110.68%}
}
@media screen and (-webkit-min-device-pixel-ratio: 3){
html,body{font-size:106.25%}
}
}
@media screen and (min-width: 540px) {
html,body{font-size: 150%}
}