我想使用 2 张图像作为固定图像的背景图像,所以我使用了 body 上的代码。
background: url(images/31.jpg) 100% no-repeat, url(images/12.jpg) 100% no-repeat;
background-position: fixed;
我需要它们 100% 适合浏览器宽度,并且我希望图像 2 在图像 1 之后垂直堆叠。我已经阅读了很多关于通过 CSS3 使用多个图像的网站。这在没有 JavaScript 的情况下是否可行?如果可以,为什么我的图像会堆叠在一起,而图像 1 不是从左上角开始的?
最佳答案
the following reference css try it
#idName {
background-image: url(image1.png),url(image2.png);
background-position: center bottom, left top;
background-repeat: no-repeat;
}
关于css3 在 body 上堆叠 2 个背景图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22040893/