gpt4 book ai didi

html - Div 在另一个 div css 中?

转载 作者:太空宇宙 更新时间:2023-11-04 04:14:49 25 4
gpt4 key购买 nike

我在父 div 中有 2 个 div..我需要父 div 在悬停时变亮..这是 fiddle ..我尝试使用悬停,但无法得到它...请提供任何帮助

http://jsfiddle.net/d9yPK/

html:

  <div class="parent" style="border:1px solid black;">
<div class="one">
<img class="img1" src="http://static.howstuffworks.com/gif/vincent- van-gogh-paintings-from-saint-remy-2.jpg"/>
</div>
<div class="two">
<img class="img2" src="http://static.howstuffworks.com/gif/vincent-van-gogh-paintings-from-saint-remy-2.jpg"/>
</div>
</div>

最佳答案

首先,您在 CSS .parent hover 中有这个。但它之间需要一个 : 而不是空格,例如:.parent:hover

同时从 parent div 中删除 style 属性。只需在您的 CSS 中定义一个边框即可。

现在您应该可以使用 parent 类中的hover:http://jsfiddle.net/d9yPK/4/

关于html - Div 在另一个 div css 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20115010/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com