要設(shè)置頂部工具提示,請使用 bottomCSS 屬性。
您可以嘗試運行以下代碼將頂部工具提示設(shè)置為文本:
示例
現(xiàn)場演示
<!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>
登錄后復(fù)制
以上就是使用 CSS 設(shè)置頂部工具提示的詳細內(nèi)容,更多請關(guān)注www.92cms.cn其它相關(guān)文章!






