css3-translate3d-模糊bug - css3怎么解決1px的邊框模糊
問題描述
我這個(gè)關(guān)閉按鈕的邊框和那個(gè)叉叉都會(huì)有模糊要怎么解決
<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:你這個(gè)看起來好 高端(而且也好復(fù)雜的樣子)。現(xiàn)在用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里的所有元素設(shè)置為雙倍大小,然后對(duì).icon_close用tranform: scale(0.5)縮小一半。
回答3:transform: translateZ(0);
有些性能不是很高的設(shè)備,或者性能分配資源太少會(huì)這樣。強(qiáng)制用3D觸發(fā)硬件渲染,可能會(huì)解決。
相關(guān)文章:
1. python小白 關(guān)于類里面的方法獲取變量失敗的問題2. thinkPHP5中獲取數(shù)據(jù)庫數(shù)據(jù)后默認(rèn)選中下拉框的值,傳遞到后臺(tái)消失不見。有圖有代碼,希望有人幫忙3. linux運(yùn)維 - python遠(yuǎn)程控制windows如何實(shí)現(xiàn)4. Python2中code.co_kwonlyargcount的等效寫法5. javascript - 如何用最快的速度C#或Python開發(fā)一個(gè)桌面應(yīng)用程序來訪問我的網(wǎng)站?6. django - Python error: [Errno 99] Cannot assign requested address7. mysql數(shù)據(jù)庫做關(guān)聯(lián)一般用id還是用戶名8. [python2]local variable referenced before assignment問題9. 求救一下,用新版的phpstudy,數(shù)據(jù)庫過段時(shí)間會(huì)消失是什么情況?10. python小白,關(guān)于函數(shù)問題
