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
|
// 正常的样例盒子
.copy-tooltip-box {
bottom: calc(100% + 14px);
position: absolute;
left: 50%;
transform: translateX(-50%);
background-color: #323233D9; /* 黑色主题 */
width: 88px;
height: 28px;
color: #fff;
}
// 伪类实现方法
.copy-tooltip-box:after {
content: "";
position: absolute;
top: 100%;
/* 箭头位于提示框底部 */
left: 50%;
transform: translateX(-50%);
width: 0;
height: 0;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-top: 10px solid #323233D9;
}
|