使用 CSS 设置顶部工具提示
要设置顶部工具提示,请使用 bottomCSS 属性。
您可以尝试运行以下代码将顶部工具提示设置为文本:
示例
现场演示
<!DOCTYPE html>
<html>
<style>
.mytooltip .mytext {
visibility: hidden;
width: 140px;
background-color: blue;
color: #fff;
z-index: 1;
bottom: 100%;
left: 60%;
margin-left: -90px;
text-align: center;
border-radius: 6px;
padding: 5px 0;
position: absolute;
}
.mytooltip {
position: relative;
display: inline-block;
margin-top: 50px;
}
.mytooltip:hover .mytext {
visibility: visible;
}
</style>
<body>
<div class = mytooltip>Keep mouse cursor over me
<span class = mytext> My Tooltip text</span>
</div>
</body>
</html>
以上就是使用 CSS 设置顶部工具提示的详细内容,更多请关注双恒网络其它相关文章!
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。



