powerdong / myProblems

我用到了,你可能用到
0 stars 1 forks source link

移动端1px实现 #30

Open powerdong opened 4 years ago

powerdong commented 4 years ago
// 1条border
.setOnePx{
  position: relative;
  &::after{
    position: absolute;
    content: '';
    background-color: #e5e5e5;
    display: block;
    width: 100%;
    height: 1px; /*no*/
    transform: scale(1, 0.5);
    top: 0; // 控制哪个方向
    left: 0;
  }
}
.setBorderAll{
     position: relative;
       &:after{
           content:" ";
           position:absolute;
           top: 0;
           left: 0;
           width: 200%;
           height: 200%;
           transform: scale(0.5);
           transform-origin: left top;
           box-sizing: border-box;
           border: 1px solid #E5E5E5;
           border-radius: 4px;
      }
    }