创建一个工具提示,当用户使用CSS将鼠标移到元素上时显示
您可以尝试运行以下代码来创建工具提示,将鼠标悬停时可见。使用可见性属性
示例
<!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>热门推荐
10 企业励志拜年祝福语简短
11 学生毕业季祝福语简短
12 入学校简短祝福语
13 女性生日祝福语简短优美
14 幸福卡片祝福语英文简短
15 牛年佛家祝福语大全简短
16 毕业祝福语保安文案简短
17 生日油画棒祝福语简短
18 祝福语年轻回复文案简短