gpt4 book ai didi

html - 有什么命令可以覆盖背景图片的img标签的图片吗?

转载 作者:太空宇宙 更新时间:2023-11-04 02:08:15 24 4
gpt4 key购买 nike

它被插入到 li 类的背景图像中。

里面li类img标签有。

li类标签上的背景图,你怎么占到最上面呢?

<style>
.wrap {
width: 100%;
overflow: hidden;
position: relative;
height: 625px;
}
.ul-wrap {
width: auto;
position: relative;
}
li.full-image.guest_bulr {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVQoU2NkIAJ4e3sbMxJSB1K0devWs3gVwhSBDMOpEFkRToXoirAqxKYIQyEuRSgK8SmCKySkCKyQGEUghQBteCUf8jBb4wAAAABJRU5ErkJggg==);
position: absolute;
top: 0;
bottom: 0;
right: 0;
width: 980px;
height: 625px;
z-index: 999;
display: none;
background-color: rgba(21, 18, 18, 0.9);
zoom: 1;
background-size: cover;
}

.wrap img {
max-width: 100%;
display: block;
}

</style>

<div class="wrap">
<ul class="ul-wrap">
<li>
<img src="http://placehold.it/980x625/?text=image-1st" alt="image" class="first-img">
</li>
</ul>
</div>

最佳答案

使用 .first-img 相对。查看工作示例。

.wrap {
width: 100%;
overflow: hidden;
position: relative;
height: 625px;
}
.ul-wrap {
width: auto;
position: relative;
}

.ul-wrap li {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVQoU2NkIAJ4e3sbMxJSB1K0devWs3gVwhSBDMOpEFkRToXoirAqxKYIQyEuRSgK8SmCKySkCKyQGEUghQBteCUf8jBb4wAAAABJRU5ErkJggg==);
display: block;
position: relative;
width: 980px;
height: 625px;
background-size: cover;
background-color: rgba(255, 0, 0, 0.4);
}

.wrap img {
max-width: 100%;
}

.first-img {
position: relative;
z-index: -1;
}
<div class="wrap">
<ul class="ul-wrap">
<li>
<img src="http://placehold.it/980x625/?text=image-1st" alt="image" class="first-img">
</li>
</ul>
</div>

关于html - 有什么命令可以覆盖背景图片的img标签的图片吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40273620/

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