कैसे करें - टूलटिप
CSS के साथ टूलटिप बनाने का तरीका जानें।
नीचे दिए गए टेक्स्ट पर होवर करें:
शीर्ष
टूलटिप टेक्स्ट
सही
टूलटिप टेक्स्ट
नीचे
टूलटिप टेक्स्ट
बाएं
टूलटिप टेक्स्ट
टूलटिप्स कैसे बनाएं
चरण 1) HTML जोड़ें:
उदाहरण
<div class="tooltip">Hover over me
<span class="tooltiptext">Tooltip
text</span>
</div>
चरण 2) सीएसएस जोड़ें:
उदाहरण
/* Tooltip container */
.tooltip {
position:
relative;
display: inline-block;
border-bottom: 1px dotted black; /* If you want dots under the hoverable
text */
}
/* Tooltip text */
.tooltip .tooltiptext
{
visibility: hidden;
width:
120px;
background-color: #555;
color: #fff;
text-align: center;
padding: 5px 0;
border-radius: 6px;
/* Position the tooltip text */
position: absolute;
z-index: 1;
bottom: 125%;
left:
50%;
margin-left: -60px;
/*
Fade in tooltip */
opacity: 0;
transition: opacity 0.3s;
}
/* Tooltip arrow */
.tooltip .tooltiptext::after
{
content: "";
position:
absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: #555 transparent
transparent transparent;
}
/* Show the tooltip text when
you mouse over the tooltip container */
.tooltip:hover .tooltiptext {
visibility: visible;
opacity: 1;
}
युक्ति: टूलटिप्स के बारे में अधिक जानने के लिए हमारे CSS टूलटिप ट्यूटोरियल पर जाएं।
युक्ति: "क्लिक करने योग्य" टूलटिप्स बनाने के लिए, हमारे हाउ टू क्रिएट पॉपअप ट्यूटोरियल पर जाएं
युक्ति: मोडल भी टूलटिप्स के समान होते हैं। मॉडल्स के बारे में जानने के लिए हमारे हाउ टू क्रिएट मॉडल्स ट्यूटोरियल पर जाएं।