Hi, does anyone know why my tooltip only opens up to the top? (It gets cut off when I scroll down).
Also, how do I make my header sticky? It does not seem to work.
Attached is my CSS code.
#tooltip
{
text-align: center;
color: #fff;
background: #111;
position: absolute;
z-index: 100;
padding: 15px;
width: max-content;
max-width: 200px;
}
#tooltip:after /* triangle decoration */
{
width: 0;
height: 0;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-top: 10px solid #111;
content: '';
position: absolute;
left: 50%;
bottom: -10px;
margin-left: -10px;
}
#tooltip.top:after
{
border-top-color: transparent;
border-bottom: 10px solid #111;
top: -20px;
bottom: auto;
}
#tooltip.left:after
{
left: 10px;
margin: 0;
}
#tooltip.right:after
{
right: 10px;
left: auto;
margin: 0;
}
table.my_table {
font-size: 11px;
border-collapse: collapse;
border: solid 2px;
width: 100%;
}
table.my_table td, table.my_table th {
padding: 2px;
text-align: center;
margin: 0;
border: solid 1px;
}
table.my_table th {
background-color: #DCDCDC;
border: solid 1px;
border-bottom: solid 2px;
position: -webkit-sticky;
position: sticky;
top: 0;
z-index: 2;
}
Page 1 / 1
Try using position : relative for your tooltip code; it helped me when i was working with multi options having tooltip and it was sharing the same behavior i.e. (tooltip was cutting off).
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.