CSS 实现 0.5px 边框线
生活随笔
收集整理的這篇文章主要介紹了
CSS 实现 0.5px 边框线
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
原有元素要添加 position: relative; ::before偽元素一點(diǎn)要加z-index屬性保證原有元素處于后加元素上層,否則會(huì)導(dǎo)致原有元素上點(diǎn)擊等事件觸發(fā)不了
<div class="top border-line">
</div>
.top {
position: relative;}
.border-line::before {
z-index: -999; content: ''; position: absolute; top: 0; left: 0; border-bottom: 1px solid #000; width: 200%; height: 200%; transform-origin: 0 0; transform: scale(0.5, 0.5); box-sizing: border-box;}
總結(jié)
以上是生活随笔為你收集整理的CSS 实现 0.5px 边框线的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 新的一年babel了解一下
- 下一篇: webpack3 css,媒体查询不能使