【发布时间】:2018-12-24 23:50:57
【问题描述】:
我想在父 div 悬停时更改子 div 图像的不透明度。如何在 CSS 中做到这一点?
<div class="parent">
<div class="child">
<img src="" alt="" height="" width="">
</div>
</div>
【问题讨论】:
-
不要告诉我你在搜索时一无所获? google.com/…
-
@TemaniAfif 没有sn-p,没有解释,并且对于这个级别的问题难度获得75分的公认答案超出了我的范围。另外,它甚至不能准确回答这个问题。
change the child div image opacity when the parent div is hovered应该翻译成.parent:hover .child img { opacity: 0.7 } -
@MihaiT 祝你好运,找到鼓励这种琐碎而明显的问题一次又一次被问到的支持者;)