我想更改 #pianist a:hover
上 div.button 的背景图片。这可以用 CSS 实现吗?
<a id="pianist">
<div class="button"></div>
<h2>PIANIST</h2>
</a>
最佳答案
您可以通过将其嵌套在 #pianist:hover
下来定位它,如下所示:
#pianist:hover .button {
background-color: red; /* replace with desired background declaration */
}
关于css - 更改包裹在 :hover? anchor 中的 div 的背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19342106/