1像素邊框

使用的是gulp-less編譯less,gulp-postcss和postcss-px2rem裝換px,/no/表示不編譯,項目採用的是flexible.js,安卓的dpr統一爲1,安卓中1px轉換成rem是看不見的。css

一、若是不是特別糾結那點像素,像圓角邊框就能夠這麼實現: border:1px solid red;/no/ border-radius:10px;gulp

二、能夠用漸變來實現less

三、僞類post

// 移動1像素表現
.setTopLine(@c: #E6E6E6) {
  content: " ";
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  height: 1px;/*no*/
  border-top: 1px solid @c;/*no*/
  color: @c;
  transform-origin: 0 0;
  transform: scaleY(0.5);
}

.setBottomLine(@c: #E6E6E6) {
  content: " ";
  position: absolute;
  left: 0;
  bottom: 0;
  right: 0;
  height: 1px;/*no*/
  border-bottom: 1px solid @c;/*no*/
  color: @c;
  transform-origin: 0 100%;
  transform: scaleY(0.5);
}

.setLeftLine(@c: #E6E6E6) {
  content: " ";
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;/*no*/
  bottom: 0;
  border-left: 1px solid @c;/*no*/
  color: @c;
  transform-origin: 0 0;
  transform: scaleX(0.5);
}

.setRightLine(@c: #E6E6E6) {
  content: " ";
  position: absolute;
  right: 0;
  top: 0;
  width: 1px;/*no*/
  bottom: 0;
  border-right: 1px solid @c;/*no*/
  color: @c;
  transform-origin: 100% 0;
  transform: scaleX(0.5);
}
相關文章
相關標籤/搜索