css3做0.5px细线

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title>
<style>

.div1:before{ 
    content: " "; 
    position: absolute; 
    left: 0; top: 0; 
    right: 0; 
    height: 1px; 
    border-top: 1px solid #D9D9D9; 
    color: #D9D9D9; 
    -webkit-transform-origin: 0 0; 
    transform-origin: 0 0; 
    -webkit-transform: scaleY(0.5); 
    transform: scaleY(0.5); 
}
    .div2{
      border:1px solid red;
    }
</style>
</head>
<body>
<div class="div1">这里是盒子内的实际内容。有 25px 内间距,25px 外间距、25px 绿色边框。</div>
    <div class="div2"></div>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/mbh12333/article/details/80596387
今日推荐