CSS 代码:生成右下角弹出快捷键提示框
<style>
.gui {
position: relative;
}
.gui:after {
content: attr('data-shortcut');
position: absolute;
bottom: -30px;
right: -30px;
padding: 10px;
background-color: #333;
color: #fff;
border-radius: 5px;
z-index: 999;
opacity: 0;
transition: opacity 0.2s ease-in-out;
}
.gui:hover:after {
opacity: 1;
}
</style>
<div class='gui' data-shortcut='Ctrl+Alt+C'>
这个元素可以使用快捷键Ctrl+Alt+C来操作
</div>
原文地址: https://www.cveoy.top/t/topic/mW7X 著作权归作者所有。请勿转载和采集!