image2是一个壁纸大小jpg和image1是一个小图像。在另一个背景顶部显示图像背景的原始大小
为什么image1的缩放比例较大,如何以image2的原始大小显示它?
html {
background: url("image1.jpg") no-repeat, url("image2.jpg") no-repeat center center fixed;
}
image2是一个壁纸大小jpg和image1是一个小图像。在另一个背景顶部显示图像背景的原始大小
为什么image1的缩放比例较大,如何以image2的原始大小显示它?
html {
background: url("image1.jpg") no-repeat, url("image2.jpg") no-repeat center center fixed;
}
你的问题不是很清楚,但我会尽我所能提供帮助。
首先,我想看看这篇文章的背景图像叠加它会帮助您在订单方面:
https://css-tricks.com/stacking-order-of-multiple-backgrounds/
我建议,你需要做到以下几点:
html {
background:
url("image2.jpg") no-repeat center center fixed,
url("image1.jpg") no-repeat;
}
您可能还需要一个回退,具体取决于浏览器支持。
如果您可以提供一个codepen这将有助于
尝试像
html {
background:
url("image1.jpg")
no-repeat;
}
.image2 {
url("image2.jpg")
no-repeat center center fixed;
}
<html>
<div class="image2"></div>
</html>
答案是HTML标签的背景图像将总是延长没有办法解决它。
你能做一个小提琴或一个片段来重现问题吗?我无法重现它 –
image1与屏幕的大小拉伸,问题是如何在html css选择器中以原始大小显示image1。 – cw12345
在你的问题中,你说了一些关于image2拉伸的东西,现在你说的是image1 :)。请更清楚,并提供所有必要的信息(最好是一个工作示例) –