
当用户将鼠标光标移动到文本上时,工具提示可见。您可以在其中添加信息以方便用户理解。
示例
您可以尝试运行以下代码来了解如何创建工具提示 -
现场演示<!DOCTYPE html>
<html>
<style>
#mytooltip #mytext {
visibility: hidden;
width: 100px;
background-color: black;
color: #fff;
text-align: center;
border-radius: 3px;
padding: 10px 0;
position: absolute;
z-index: 1;
}
#mytooltip:hover #mytext {
visibility: visible;
}
</style>
<body>
<div id = "mytooltip">Hover the mouse over me
<p id = "mytext">My Tooltip text</p>
</div>
</body>
</html>










