我有一个父级div。
然后我在其中放置了一个子div。
#myParentDiv{
width: 100px;
height: 200px;
}
然后我在其中放置了一个子div。
#myChildDiv{
width: 100%;
height: 100%;
}
在子元素内部,我有一个按钮。该按钮设置了 background-image
#backgroundIndiseChild{
background-image: url(/img/img.jpg);
background-repeat: no-repeat;
background-size: 50%;
cursor: pointer;
}
我的问题:当鼠标悬停在#myChildDiv
的任何部分时,光标会变成cursor:pointer
。我该如何使鼠标仅在悬停在#backgroundIndiseChild
上时才更改为指针形状?
background-size: 50%
。 图像仅占用50%的空间,但这并不意味着另一个区域不是#backgroundIndiseChild
元素的一部分。 - Harry:hover
。如果你认为这没有什么价值,随时可以恢复。 - Harry