gpt4 book ai didi

html - 页面底部有两个重叠的图像

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

我需要始终显示在页面底部的 2 个重叠图像,但不是 position:fixed:

<div class="images">
<img src="img1.jpg" class="image1" />
<img src="img2.jpg" class="image2" />
</div>

我试过这个:

    img.image1, img.image2 {position: absolute; right:5px; bottom:5px;}
img.image2 {z-index:10;}

如果页面没有滚动条,效果很好

已解决:使用float + position:relative

最佳答案

将外部 div 固定在底部。然后对内部图像使用绝对值。

.images { position:fixed; bottom:0; }
.images > img { position:absolute; bottom:5px; right:5px;}

关于html - 页面底部有两个重叠的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9428183/

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