Template:Tooltip/tooltip.css: Difference between revisions
From SNCApedia, the shit nobody cares about encyclopedia
Jump to navigationJump to search
No edit summary Tag: Reverted |
No edit summary Tag: Reverted |
||
| Line 27: | Line 27: | ||
bottom: 125%; | bottom: 125%; | ||
} | } | ||
.tooltip .tooltiptext.above::after { | .tooltip .tooltiptext.above::after { | ||
content: ""; | content: ""; | ||
position: absolute; | position: absolute; | ||
top: 100%; | top: 100%; /* arrow points down */ | ||
left: 50%; | left: 50%; | ||
margin-left: -5px; | margin-left: -5px; | ||
| Line 43: | Line 42: | ||
top: 125%; | top: 125%; | ||
} | } | ||
.tooltip .tooltiptext.below::after { | .tooltip .tooltiptext.below::after { | ||
content: ""; | content: ""; | ||
position: absolute; | position: absolute; | ||
bottom: 100%; | bottom: 100%; /* arrow points up */ | ||
left: 50%; | left: 50%; | ||
margin-left: -5px; | margin-left: -5px; | ||
Revision as of 21:54, 5 April 2026
.tooltip {
position: relative;
display: inline-block;
cursor: help;
text-decoration: underline dotted; /* like <abbr> */
}
.tooltip .tooltiptext {
visibility: hidden;
background-color: #000; /* pure black */
color: #fff;
text-align: center;
border-radius: 6px;
padding: 6px;
position: absolute;
z-index: 1;
left: 50%;
transform: translateX(-50%);
opacity: 0;
transition: opacity 0.3s;
white-space: normal;
max-width: 300px;
}
/* Default position: above */
.tooltip .tooltiptext.above {
bottom: 125%;
}
.tooltip .tooltiptext.above::after {
content: "";
position: absolute;
top: 100%; /* arrow points down */
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: #000 transparent transparent transparent;
}
/* Alternate position: below */
.tooltip .tooltiptext.below {
top: 125%;
}
.tooltip .tooltiptext.below::after {
content: "";
position: absolute;
bottom: 100%; /* arrow points up */
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: transparent transparent #000 transparent;
}
/* Show tooltip on hover */
.tooltip:hover .tooltiptext {
visibility: visible;
opacity: 1;
}