要設置左側工具提示,請使用right?CSS屬性。
您可以嘗試運行以下代碼來將左側工具提示設置為文本:
示例
實時演示
<!DOCTYPE html> <html> <style> .mytooltip .mytext { visibility: hidden; width: 140px; background-color: orange; color: white; z-index: 1; top: -6px; right: 100%; text-align: center; border-radius: 6px; padding: 5px 0; position: absolute; } .mytooltip { position: relative; display: inline-block; margin-left: 150px; } .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 設置左側工具提示的詳細內容,更多請關注www.92cms.cn其它相關文章!