Skip to content

Instantly share code, notes, and snippets.

@wxingheng
Created May 22, 2019 02:36
Show Gist options
  • Save wxingheng/ede3243a78a74f39c564b14c7d103c87 to your computer and use it in GitHub Desktop.
Save wxingheng/ede3243a78a74f39c564b14c7d103c87 to your computer and use it in GitHub Desktop.
移动端1px细线解决方案总结
- :before, :after与transform
```language
.radius-border{
position: relative;
}
@media screen and (-webkit-min-device-pixel-ratio: 2){
.radius-border:before{
content: "";
pointer-events: none; /* 防止点击触发 */
box-sizing: border-box;
position: absolute;
width: 200%;
height: 200%;
left: 0;
top: 0;
border-radius: 8px;
border:1px solid #999;
-webkit-transform(scale(0.5));
-webkit-transform-origin: 0 0;
transform(scale(0.5));
transform-origin: 0 0;
}
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment