将鼠标悬停在容器上时 CSS 转换图像

标签 css image animation html containers

有没有办法使用 CSS 制作如下容器:

#p-container .p-categories-item

影响那个div中的图像?我在图像上有一个 CSS 动画,但我希望当我将鼠标悬停在整个元素上时播放它,而不仅仅是实际图像本身。谢谢。

最佳答案

只需使用 #p-container .p-categories-item:hover img {/* stuff */} 选择 .p-categories-item 中的图像> 仅当鼠标悬停在元素上时。

关于将鼠标悬停在容器上时 CSS 转换图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6604858/

相关文章:

javascript - jQuery css 动画可见性

javascript - 使用 Prototype/Scriptaculous 预加载图像

image - Next.js:使用图像组件时的空 alt 标签

ios - 动画 Objective-C

javascript - 将具有相同类的 DIV 加载到模态对话框中

image - CSS3 : how to skew x-angles of image in different directions using only 2D transform?

ios - 给 UIImageView 添加动画

html - 在 div 下推送列表

css - 如何删除标题 img 下方的空间

html - 如何在导航栏上将我的列表分成两部分?