示例
实时演示
<!DOCTYPE html> <html> <style> .mytooltip .mytext { visibility: hidden; width: 140px; background-color: blue; color: #fff; z-index: 1; top: 150%; left: 50%; margin-left: -60px; text-align: center; border-radius: 6px; padding: 5px 0; position: absolute; } .mytooltip { position: relative; display: inline-block; } .mytooltip .mytext:after { content: ""; position: absolute; bottom: 100%; left: 50%; margin-left: -10px; border-width: 3px; border-style: solid; border-color: transparent transparent blue transparent; } .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 将箭头指向工具提示顶部的详细内容,更多请关注编程之家其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。