gpt4 book ai didi

css - 悬停时,在 div 右侧显示图像

转载 作者:行者123 更新时间:2023-12-01 02:36:58 27 4
gpt4 key购买 nike

我有一个操作列表(创建免费帐户、查看统计信息等)。这是它的样子。

        <div class="box_go">
<div class="ico"><img src="img/ico/arrow_f.png" width="16" /></div>
<h3>Get a free account</h3>
<p>And start earning points</p>
</div>
<div class="box_go">
<div class="ico"><img src="img/ico/arrow_f.png" width="16" /></div>
<h3>View stats</h3>
<p></p>
</div>

我希望鼠标悬停时父 div 的右侧出现一个小箭头 (div.ico)。使用 jQuery...但是当我将鼠标悬停在第一个元素上时,两个箭头都会显示...

有什么想法吗?谢谢!

最佳答案

为什么不直接使用 CSS?

.box_go {
position: relative;
}

.box_go .ico {
position: absolute;
right: 10px;
display: none;
}

.box_go:hover .ico {
display: block;
}

关于css - 悬停时,在 div 右侧显示图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4174418/

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