用纯 CSS 实现的标签 🏷️ 效果,符合简洁需求,不想引入字体图案的可以这么做。
1
<div class='content'>• Some Text</div>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
body {
background-color: hsl(198, 83%, 91%);
}
.content:before {
content: " ";
display: block;
width: 0;
height: 0;
border-top: 9px solid transparent;
border-bottom: 8px solid transparent;
border-right: 8px solid hsl(200, 33%, 58%);
position: absolute;
top: 50%;
margin-top: -9px;
right: 100%;
z-index: 2;
}
.content {
background-color: hsl(200, 33%, 58%);
color: white;
text-decoration: none;
text-transform: uppercase;
padding: 2px 4px 3px 2px;
background: hsl(200, 33%, 58%);
position: relative;
display: block;
float: left;
position:relative;
font-size: 13px;
height: 15px;
}