也是一个 小的 div然后 border 就能实现
<!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>
<style>
*{
margin: 0;
padding: 0;
}
.label{
width: auto;
height: 15px;
line-height: 15px;
text-align: center;
border: 1px solid red;
border-radius: 3px;
display: inline-block;
color: red;
font-size: 12px;
}
</style>
</head>
<body>
<div class="label">
限时赠
</div>
</body>
</html>
<!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>界面</title>
</head>
<body>
<span class="tag">限时赠</span>
</body>
<style>
.tag{
border: 1px solid red;
color: red;
font-size: 12px;
padding: 0 2px;
border-radius: 3px;
}
</style>
</html>
1.盒子的边框用 border:1px solid red (宽度,线的类型,颜色)
2.四个角是圆角用 border-radius:5px (可以是大小px,也可是%)