移动端样式注意问题

文字大小:


@media screen and (min-width: 300px) {
  html {
    font-size: 27.77783333333333px;
  }
}
@media screen and (min-width: 315px) {
  html {
    font-size: 29.166724999999996px;
  }
}
@media screen and (min-width: 330px) {
  html {
    font-size: 30.555616666666666px;
  }
}
@media screen and (min-width: 345px) {
  html {
    font-size: 31.94450833333333px;
  }
}
@media screen and (min-width: 360px) {
  html {
    font-size: 33.3334px;
  }
}
@media screen and (min-width: 375px) {
  html {
    font-size: 34.72229166666666px;
  }
}
@media screen and (min-width: 390px) {
  html {
    font-size: 36.11118333333333px;
  }
}
@media screen and (min-width: 405px) {
  html {
    font-size: 37.500074999999995px;
  }
}
@media screen and (min-width: 420px) {
  html {
    font-size: 38.88896666666666px;
  }
}
@media screen and (min-width: 435px) {
  html {
    font-size: 40.27785833333333px;
  }
}

文字间距:

 单行:line-height:1;----避免在计算margin的时候在计算下图中绿色空白部分的高度

 多行:有line-height时

文字行高:(文字大小+标注margin高度)/100 


两端对齐:

text-align:justfy


移动端一像素border

.border-1px, .top-1px, .bottom-1px{  position:relative}
.border-1px{  overflow:visible;    border-radius: 10px;}
@media screen and (-webkit-min-device-pixel-ratio:1) {
    .top-1px:before, .bottom-1px::after{
    content: '';
    position:absolute;
    left: 0px;
     right: 0px;
     height: 1px;
     width:100%;
    background: #d8d8d8;
    transform:scale(1);
    transform-origin :left top;
    }
    .bottom-1px::after{
    bottom:0;}
    .top-1px:before{
     top: 0;
    }
    .border-1px::before{
    content: ''
    width:100%
    height: 100%
    border:1px solid #ccc
    position:absolute ;
        left:0;
    top: 0;
        border-radius: 10px;
    }
}
    @media screen and (-webkit-min-device-pixel-ratio:2){
        .top-1px:before, .bottom-1px::after{
        content :'';
        position:absolute;
        left:0px;
        right:0px;
        height:1px;
        width :200%;
        background :#d8d8d8;
        transform:scale(0.5);
        transform-origin:left top;
        }
        .bottom-1px::after{
        bottom:0;
        transform-origin:left bottom;
        }
        .top-1px:before{
        top:0;
        }
        .border-1px::before{
        content:'';
        width :200%;
        height: 200%;
        border: 1px solid #ccc;
        position: absolute;
        left: 0;
        top: 0;
        transform: scale(.5);
        transform-origin: left top;
            border-radius: 10px;
        }
    }
        @media screen and (-webkit-min-device-pixel-ratio:3){
            .top-1px:before, .bottom-1px::after{
            content:'';
            position :absolute
            left: 0px;
            right: 0px ;
            height: 1px;
            width: 300%;
            background: #d8d8d8;
            transform :scale(0.333);
            transform-origin: left top;
            }
            .bottom-1px::after{
            bottom: 0;
            transform-origin: left bottom;
            }
            .top-1px::before {
                top: 0;
            }
            .border-1px::before {
                content :'' ;
                width: 300%; height: 300%; border: 1px solid #ccc; position: absolute; left: 0; top: 0 ;transform: scale(.333334) ;transform-origin: left top;
                border-radius: 10px;
            }
        }


两端对齐IE不兼容

text-align:justify

*text-justify:inter-ideograph;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值