gpt4 book ai didi

javascript - 将鼠标悬停在效果上将图像向下推

转载 作者:行者123 更新时间:2023-11-28 05:22:44 25 4
gpt4 key购买 nike

这是 media div 的图像,我有 on hover X:

enter image description here

这是您单击 div 并上传照片时的图像。如您所见,它非常适合放在盒子里。

enter image description here

当我将鼠标悬停在图像上以查看X 时,最后这里是一个 div。

enter image description here

如您所见,图像被向下推了。 我的最终结果是让它悬停在图像上而不影响图像放置

这是我的 CSS:

.x {
color:red;
#width:50px;
#height:50px;
display:none;
#left:50px;
}
.MediaPreview:hover > .x {
display:block;
}
.MediaPreview {
position: absolute;
width: 128px;
height: 72px;
background-color: #e0e0e0;
cursor: default;
}

这是我的 HTML:

<div class="MediaPreview" style="left: 10px; bottom: 10px;">
<span>Image or video, required</span>
<div class="x">x</div>
</div>

最佳答案

试试这个?

.x {
color:red;
#width:50px;
#height:50px;
display:none;

top: 10px;
left: 10px;
position: absolute;
z-index: 1;

}
.MediaPreview:hover > .x {
display:block;
}
.MediaPreview {
position: absolute;
width: 128px;
height: 72px;
background-color: #e0e0e0;
cursor: default;
}

关于javascript - 将鼠标悬停在效果上将图像向下推,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38948212/

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