我试图在将鼠标悬停在按钮上时实现帮助光标,但问题是我无法在按钮本身上设置悬停效果(我只想影响某些按钮,并且不可能在按钮上设置唯一的类名称)这个特定的按钮)。相反,我选择在另一个 div 内渲染按钮,我希望将其设置为光标悬停效果。然而,它仅适用于按钮的最外边缘。非常感谢任何关于如何使用我的 div 设置来完成这项工作的见解
代码笔: https://codepen.io/sgoldberg/pen/vGzGYL
<div class="container">
<button class="button"> Hover Button </button>
</div>
.container {
width: 400px;
border: solid 1px black;
height: 400px;
cursor: help;
.button {
width: 100%;
height: 100%;
}
.container>.button {
cursor: help
}
<div class="container">
<button class="button">My Button</button>
</div>
<button class="button">Without container</button>