css给div添加0.5px的边框

具体代码实现如下:

 1 <!DOCTYPE html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8">
 5     <title>border</title>
 6     <style>
 7         div{
 8             position: relative;
 9             width: 100%;
10             background-color: #fff;
11         }
12         div:before{
13             content: "";
14             display: block; 
15             position: absolute;
16             left: 0;
17             right: 0;
18             height: 1px;
19             color: #d9d9d9;
20             top: 0;
21             border-top: 1px solid #d9d9d9;
22             -webkit-transform-origin: 0 0;
23             transform-origin: 0 0;
24             -webkit-transform: scaleY(.5);
25             transform: scaleY(.5);
26 
27         }
28     </style>
29 </head>
30 <body>
31     <div>
32         border 0.5px
33     </div>
34 </body>
35 </html>

 

转载于:https://www.cnblogs.com/hzd2010/p/5977120.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值