<style>
.line{
width: 500px;
height: 500px;
border: 1px solid black;
position: absolute;
top: 2px;
}
.line::before {
/* 实现宽度为0.5px的线 */
display: block;
content: "";
height: 1px;
left: -50%;
position: absolute;
background-color: red;
width: 200%;
-webkit-transform: scale(0.5);
transform: scale(0.5);
box-sizing: border-box;
}
p{
font-size: 2px;
transform: scale(0.5);
/* 实现字体缩小到12px以下 */
}
.border{
/* 实现高度半个px大小的线 宽度为50px*/
width: 100px;
height: 1px;
background-color: green;
transform: scale(0.5);
}
</style>
</head>
<body>
<div class="line">
<p>12345</p>
<div class="border"></div>
</div>
</body>