zoukankan      html  css  js  c++  java
  • css 温故而知新 1px的问题

    解决方法1:

    //border 
    @mixin border($pos, $color) {
        content: "";
        position: absolute;
        transform-origin: 0 0;
        -webkit-transform-origin: 0 0;
        @if $pos=='top'{
            #{$pos}: 0px;
            left: 0px;
            right: 0px;
            border-#{$pos}: 1px solid $color;
            transform: scaleY(.5);
            -webkit-transform: scaleY(.5);
        } @else if $pos=='bottom' {
             #{$pos}: 0px;
            left: 0px;
            right: 0px;
            border-#{$pos}: 1px solid $color;
            transform: scaleY(.5);
            -webkit-transform: scaleY(.5);
        } @else {
            top: 0px;
            bottom: 0px;
            #{$pos}: 0px;
            border-#{$pos}: 1px solid $color;
            transform: scaleX(.5);
            -webkit-transform: scaleX(.5);
        }
    }

    使用方式:

    .div {
      position:relative;
    
      &:after {
        @include border("bottom", #d9d9d9)
    left: pxToRem(30px); /* 美化,不喜欢可以不加 */
    } }

    解决方式2:

    .border { border: 1px solid #999 }
    @media screen and (-webkit-min-device-pixel-ratio: 2) {
        .border { border: 0.5px solid #999 }
    }
    @media screen and (-webkit-min-device-pixel-ratio: 3) {
        .border { border: 0.333333px solid #999 }
    }
  • 相关阅读:
    你认为做好测试计划工作的关键是什么?
    App压力测试MonkeyRunner整理
    小米2S手机
    APP耗电量专项测试整理
    App功能测试
    渗透测试_利用Burp爆破用户名与密码
    docker介绍
    redis-cluster
    Redis配置文件详情
    Redis-Sentinel哨兵
  • 原文地址:https://www.cnblogs.com/CyLee/p/7137075.html
Copyright © 2011-2022 走看看