首页
CSS
CSS 工具提示
试用:淡入式工具提示
运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <style> .tooltip { position: relative; display: inline-block; border-bottom: 1px dotted black; } .tooltip .tooltiptext { visibility: hidden; width: 120px; background-color: black; color: #fff; text-align: center; border-radius: 6px; padding: 5px 0; position: absolute; z-index: 1; bottom: 100%; left: 50%; margin-left: -60px; /* Fade in tooltip - takes 1 second to go from 0% to 100% opac: */ opacity: 0; transition: opacity 1s; } .tooltip:hover .tooltiptext { visibility: visible; opacity: 1; } </style> <body style="text-align:center;"> <h2>Fade In Tooltip on Hover</h2> <p>When you move the mouse over the text below, the tooltip text will fade in and take 1 second to go from completely invisible to visible.</p> <div class="tooltip">Hover over me <span class="tooltiptext">Tooltip text</span> </div> </body> </html>