1:用阴影实现,适用于四个边框都存在的情况
box-shadow: 0 0 0 0.5px #18181b;
2: 加一个伪元素,用放大缩小的方式,适用于任何形式的边框
.box { position: reative } .box::after { position: absolute; top: 0; left: 0; width: 200%; height: 200%; border-bottom: 1px solid #18181b; content: ''; box-sizing: border-box; transform: scale(0.5); transform-origin: left top; }
标签:box,200%,0.5,transform,边框,如何,border From: https://www.cnblogs.com/pyx-blog/p/17451253.html