0.5像素線

  1. meta viewport控制
1px像素線條
<meta name="viewport" content="width=device-width,inital-scale=1,user-scalable=0">
0.5像素線條
<meta name="viewport" content="width=device-width,inital-scale=1,user-scalable=0">
  1. background-image
    利用背景圖片漸變,從有色到透明,給人0.5像素的視覺體驗(yàn)
p{
    background-image: -webkit-linear-gradient(bottom,red 50%,transparent 50%); 
    background-image: linear-gradient(bottom,red 50%,transparent 50%); 
    background-size:  100% 1px; 
    background-repeat: no-repeat; 
    background-position: bottom right; 
}
  1. 使用transform:scale()
可以直接增加一個(gè)元素使用transform: scale()
.border-line{
    width:100%;
    height: 1px; 
    transform:scaleY(0.5);
    background: #f00;
}
或者transform: scale()+偽元素
p{
    position: relative;
}
p::before{
    content: ''; 
    position: absolute; 
    top: 0; 
    left: 0;  
    border-bottom: 1px solid #f00; 
    width: 200%; 
    height: 200%;
    transform-origin: 0 0; 
    transform: scale(0.5,0.5); 
    box-sizing: border-box;
}
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容