gpt4 book ai didi

jquery - 如何使用两个背景图像

转载 作者:可可西里 更新时间:2023-11-01 13:24:28 25 4
gpt4 key购买 nike

我在我的网站中使用了 Bootstrap 模式。我想用两张图片作为背景。我能够成功使用一张图片。当我尝试包含第二张图片时,我遇到了问题。

我的第一张图片出现在整个模态上,第二张图片很小,但我希望它出现在第一张图片之上。

我的第一张图片的 CSS 代码是

.modal-content{
background-image: url("{% static "markatix/imgs/modal/bg.png" %}");
}

我尝试了 this question 中的解决方案但是当这样写时,我的第一张图片也消失了。

我也试过

.modal-content{
background-image: url("{% static "markatix/imgs/modal/bg.png" %}") ,url("{% static "markatix/imgs/modal/bg2.png" %}") ;
background-repeat: no-repeat,no-repeat;
background-position: center, center;
}

但是它只显示了一张图片。

最佳答案

阅读此处:http://www.w3schools.com/css/css3_backgrounds.asp

#example1 {
background-image: url(http://www.thedesignwork.com/wp-content/uploads/2011/10/Random-Pictures-of-Conceptual-and-Creative-Ideas-02.jpg), url(https://s-media-cache-ak0.pinimg.com/originals/f5/9b/1b/f59b1b0cc430702e82dea90780d7f87d.gif);
background-position: right bottom, left top;
background-repeat: no-repeat, no-repeat;
background-size: 20%, 20%;
height: 100vh;
width: 100%;
}
<div id="example1"></div>

关于jquery - 如何使用两个背景图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41096599/

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