css公共方法

处理响应式布局

//公共部分
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%}
}

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

浪里个浪里个浪里个浪

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值