效果图
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<title>Document</title>
<style>
body{
background: #000;
display: flex;
align-items: center;
justify-content: center;
}
div{
margin-top: 100px;
width: 300px;
height: 2px;
background: linear-gradient(to right, transparent 0%, transparent 50%,#ffc184 50%,#ffc184 100%);
background-size: 15px 1px;
background-repeat: repeat-x;
}
</style>
</head>
<body>
<div></div>
</body>
</html>