<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<style type="text/css">
.box {
width: 200px;
height: 200px;
background-color: wheat;
}
.line::after {
background-color: pink;
content: "";
display: block;
box-sizing: border-box;
width: 200vw;
height: 1px;
transform: scale(0.5);
position: absolute;
left: -50%;
}
</style>
<body>
<div class="box"></div>
<div class="line"></div>
</body>
</html>
用 CSS 实现高度为 0.5 像素的线条
最新推荐文章于 2024-04-13 00:00:00 发布