-
Notifications
You must be signed in to change notification settings - Fork 0
/
hoverstuff
155 lines (118 loc) · 2.39 KB
/
hoverstuff
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/home/benj/repos/searx-space/html/main.css
search for tooltip this is exactly what I want
.info-tooltip {
display: none;
position: absolute;
padding: 0.5rem;
margin: 0rem 0 0 2rem;
border: 1px solid black;
background: white;
font-family: monospace;
font-style: inherit;
font-variant: normal;
font-weight: normal;
z-index: 1000000;
text-align: left;
}
.info-tooltip p {
margin: 0.125rem;
}
.info-tooltip td {
padding: 0.25rem;
overflow: hidden;
text-align: left;
text-overflow: ellipsis;
word-break: keep-all;
white-space: nowrap;
max-width: 90rem;
}
.info-tooltip a {
color: inherit;
text-decoration: none;
}
.info-tooltip a:hover {
color: inherit;
text-decoration: underline;
}
a:hover + .info-tooltip,
span:hover + .info-tooltip,
.info-tooltip:hover {
display: block;
}
==========
.tooltip-text {
display: none;
background-color: black;
color: white;
border-radius: 5px;
padding: 5px;
position: absolute;
white-space: nowrap;
top: 100%;
left: 50%;
transform: translate(-50%, 10px);
}
button:hover .tooltip-text {
display: block;
}
a:hover .tooltip-text {
display: block;
}
.tooltip {
position: relative;
display: inline-block;
}
.tooltip:hover .tooltiptext,
.tooltiptext:hover {
visibility: visible;
opacity: 1;
}
.tooltip .tooltiptext {
visibility: hidden;
background-color: #555;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px 0;
position: absolute;
z-index: 1;
opacity: 0;
transform: translate(-50%, 10px);
top: 100%;
left: 50%;
transition: opacity 0.3s;
}
.tooltip:hover .tooltiptext {
visibility: visible;
opacity: 1;
}
@media only screen and (max-width: 800px) {
button:hover .tooltip-text {
display: none;
}
a:hover .tooltip-text {
display: none;
}
.tooltip:hover .hoverable,
.hoverable:hover {
visibility: visible;
}
```
.hoverable {
position: absolute;
width: 200px; /* adjust as needed */
height: 200px; /* adjust as needed */
top: -50px; /* adjust as needed to position hoverable */
left: -50px; /* adjust as needed to position hoverable */
z-index: 1; /* keep it on top */
visibility: hidden; /* starts hidden */
}
}
<div class="tooltip">
<a href="#">Hover me! </a>
<div class="hoverable">
<div class="tooltiptext">
I am the tooltip!
</div>
</div>
</div>