css3-translate3d-模糊bug - css3怎么解决1px的边框模糊
问题描述
我这个关闭按钮的边框和那个叉叉都会有模糊要怎么解决
<p class='popmidbox'> <p class='icon_close'></p></p>.popmidbox{ width:300px; height: 200px;border: 1px solid #ccc;margin: 100px auto;position: relative;}.icon_close{ width: 16px;height: 16px;border-radius: 50%;border:1px solid #CCC;background: #fff; padding: 5px;position:absolute;top: -12px;right: -12px;z-index: 2;}.icon_close::before{ content:'';transform: rotate(-45deg);-webkit-transform: rotate(-45deg); width: 1px;height: 17px;background: #ccc;overflow: hidden;position: absolute; top:5px;left: 13px;}.icon_close::after{ content:'';transform: rotate(45deg);-webkit-transform: rotate(45deg); width: 1px;height: 17px;background: #ccc;overflow: hidden;position: absolute; top:5px;right: 13px;}
问题解答
回答1:你这个看起来好 高端(而且也好复杂的样子)。现在用SVG画的边框,感觉比较容易。
background-image: url('data:image/svg+xml;utf8,<svg xmlns=’http://www.w3.org/2000/svg’ width=’100%’ height=’100%’><line x1=’100%’ y1=’0%’ x2=’100%’ y2=’100%’ style=’stroke:#e5e5e5;stroke-width:1’/><line x1=’0%’ y1=’100%’ x2=’100%’ y2=’100%’ style=’stroke:#e5e5e5;stroke-width:1’ /></svg>'); background-repeat: no-repeat; background-position: 0 100%;
右边框和下边框
http://codepen.io/charleyw/pen/qbqgQR
回答2:可以试试将.icon_close里的所有元素设置为双倍大小,然后对.icon_close用tranform: scale(0.5)缩小一半。
回答3:transform: translateZ(0);
有些性能不是很高的设备,或者性能分配资源太少会这样。强制用3D触发硬件渲染,可能会解决。
相关文章:
1. css3 - 这个效果用 CSS 可以实现吗?border-image2. 请问一下用notepad++可以照着你这样来编吗?为什么我用notepad++编辑的时候那个容器那里颜色是黑的,不会像其他变量那样变颜色。3. mysql - 我的myeclipse一直连显示数据库连接失败,不知道为什么4. python - 在sqlalchemy中获取刚插入的数据id?5. 输入地址报以下截图错误,怎么办?6. python中生产者消费者线程问题7. 请教,关于python字典,合并相同值的键的实现方法8. 站点内容复制额外增加的版权申明,真的很反人类。试问产品自己在用这个站点吗?9. Windows系统能否利用Docker使用Ubuntu吗?Ubuntu能使用本机的显卡吗?10. javascript - js代码转python

网公网安备