-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhelpercss.py
More file actions
36 lines (33 loc) · 832 Bytes
/
helpercss.py
File metadata and controls
36 lines (33 loc) · 832 Bytes
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
def create_tooltip(title, description):
tooltip_html = f"""
<div class="tooltip">{title}
<span class="tooltiptext">{description}</span>
</div>
<style>
.tooltip {{
position: relative;
display: inline-block;
border-bottom: 1px dotted black; /* Dotted underline for the tooltip */
}}
.tooltip .tooltiptext {{
visibility: hidden;
width: 200px;
background-color: black;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px 5px;
position: absolute;
z-index: 1;
top: 30px; /* Position below the tooltip */
left: 0%;
opacity: 0;
transition: opacity 0.3s;
}}
.tooltip:hover .tooltiptext {{
visibility: visible;
opacity: 1;
}}
</style>
"""
return tooltip_html