-
Notifications
You must be signed in to change notification settings - Fork 0
/
tooltip.css
47 lines (46 loc) · 1.03 KB
/
tooltip.css
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* https://pixelbar.be/blog/css-profi-tip-tooltip-attributen/ */
.tooltip {
position: relative;
text-decoration: none;
}
.tooltip:after {
content: attr(data-tooltip);
position: absolute;
bottom: 100%;
left: 20%;
background: #ffcb66;
padding: 5px 15px;
color: black;
-webkit-border-radius: 10px;
-moz-border-radius : 10px;
border-radius : 10px;
white-space: nowrap;
opacity: 0;
-webkit-transition: all 0.4s ease;
-moz-transition : all 0.4s ease;
transition : all 0.4s ease;
}
.tooltip:before {
content: "";
position: absolute;
width: 0;
height: 0;
border-top: 20px solid #ffcb66;
border-left: 20px solid transparent;
border-right: 20px solid transparent;
-webkit-transition: all 0.4s ease;
-moz-transition : all 0.4s ease;
transition : all 0.4s ease;
opacity: 0;
left: 30%;
bottom: 90%;
}
.tooltip:hover:after {
bottom: 100%;
}
.tooltip:hover:before {
bottom: 70%;
}
.tooltip:hover:after, a:hover:before {
opacity: 1;
}