红色左右锯齿样式:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div class="coupon-input-container"></div>
<style>
.coupon-input-container {
position: relative;
background: #aa0020;
display: flex;
width: 280px;
min-height: 50px;
padding: 6px 0 6px 15px;
color: #fff;
margin-top: 25px;
align-items: center;
}
.coupon-input-container::before {
content: ' ';
width: 0;
height: 100%;
width: 0;
position: absolute;
border-right: 6px dotted white;
top: 0;
left: -3px;
}
.coupon-input-container::after {
content: ' ';
height: 100%;
position: absolute;
border-left: 6px dotted white;
top: 0;
right: -3px;
}
</style>
</body>
</html>
参考蓝色上下锯齿样式:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<style>
.dotted {
position: relative;
background: -o-linear-gradient(left, #5d95e0, #697dde);
background: -o-linear-gradient(right, #5d95e0, #697dde);
background: -moz-linear-gradient(right, #5d95e0, #697dde);
background: linear-gradient(to right, #5d95e0, #697dde);
width: 300px;
height: 200px;
}
.dotted::before {
content: ' ';
width: 0;
/* height: 100%; */
height: 0;
width: 100%;
position: absolute;
border-bottom: 10px dotted white;
top: -5px;
left: 0px;
}
.dotted::after {
content: ' ';
height: 0;
width: 100%;
position: absolute;
border-bottom: 10px dotted white;
bottom: -5px;
left: 0px;
}
</style>
<body>
<div class="dotted"></div>
</body>
</html>