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. 就一臺服務器,mysql數據庫想實現自動備份,如何設計?2. mysql - thinkphp5 在MAC電腦本地正常,部署LINUX服務器之后,模型不存在3. 編輯管理員信息時,為什么沒有修改過的內容會為空?4. 求救一下,用新版的phpstudy,數據庫過段時間會消失是什么情況?5. javascript - 百度圖片切換圖片時url會改變,但無刷新,沒用hash,IE8也支持,請問是用了什么技術?6. 這是什么情況???7. node.js - win10如何安裝并使用babel?8. python - xpath中如何使用變量9. APP上傳到電腦服務器,出現數據上傳不完整的問題10. mysql服務無法啟動1067錯誤,誰知道正確的解決方法?
