小程序1px邊框在蘋果機上變粗問題


在ios系統上1px的邊框會變成2px,ui會感覺很粗

列表間隔,只需要一條邊框

.border:after {

  position: absolute; 

  content: '';

  width: 100%;

  left: 0;

  bottom: 0;

  height: 1px;

  background-color: #e3e5e9;

  -webkit-transform: scale(1, 0.5);

  transform: scale(1, 0.5);

  -webkit-transform-origin: center bottom;

  transform-origin: center bottom;

}

通過縮放來兼容iso機

 

我們時常會遇到另外一種情況,就是頁面中的小tag 四邊boder

.border::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    border: 1px solid #eee;
    transform-origin: 0 0;
   -webkit-transform-origin: 0 0;
    transform: scale(0.5, 0.5);  
    -webkit-transform: scale(0.5, 0.5);
    box-sizing: border-box;
 }

通過整體縮放來進行兼容

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM