gpt4 book ai didi

jquery - 无法设置 JQuery 多个 css 背景,而是覆盖

转载 作者:行者123 更新时间:2023-11-28 02:57:02 26 4
gpt4 key购买 nike

我正在尝试使用 JQuery 设置 2 个背景图像。但结果只显示最后一张图片。

$(".hero-and-content").css({ 
"background-image": "url(files/bl_floral.png)",
"background-position": "bottom left",
"background-repeat": "no-repeat",
"background-size": "150px",
"background-image": "url(files/tr_floral.png)",
"background-position": "top right",
"background-attachment": "fixed",
"background-repeat": "no-repeat",
"background-size": "150px"
});

我在这里看过多篇文章。这种方法似乎对其他人有效。我是不是漏了什么?

最佳答案

这成功了。感谢对问题的评论:

$(".hero-and-content").css({ 

"background": "url('files/bl_floral.png') bottom left no-repeat, url('files/tr_floral.png') top right fixed no-repeat",
"background-size": "150px, 150px"

});

关于jquery - 无法设置 JQuery 多个 css 背景,而是覆盖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46393003/

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