移动端半像素 0.5PX 边框实现。

Posted Evo1uti0n

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了移动端半像素 0.5PX 边框实现。相关的知识,希望对你有一定的参考价值。

 1 /*半像素*/
 2 .halfpxline_after, .halfpxline_before {
 3   position: relative;
 4 }
 5 
 6 .halfpxline_after:after, .halfpxline_before:before {
 7   content: ‘‘;
 8   display: block;
 9   position: absolute;
10   left: 0;
11   right: 0;
12   height: 1px;
13   background-color: #e5e5e5;
14   -webkit-transform: scaleY(0.5);
15   transform: scaleY(0.5);
16 }
17 
18 .halfpxline_after:after {
19   bottom: 0;
20   -webkit-transform-origin: 0 1px;
21   transform-origin: 0 1px;
22 }
23 
24 .halfpxline_before:before {
25   top: 0;
26   -webkit-transform-origin: 0 0;
27   transform-origin: 0 0;
28 }

 

以上是关于移动端半像素 0.5PX 边框实现。的主要内容,如果未能解决你的问题,请参考以下文章

移动webApp - 1像素实现(点5像素的秘密)

CSS3如何实现0.5边框

css3缩放功能实现0.5px的边框

移动适配一个像素的border怎么实现

移动适配一个像素的border怎么实现

移动端Retina屏幕1px边框问题