gpt4 book ai didi

CSS3 背景 - 多个背景大小属性

转载 作者:行者123 更新时间:2023-12-03 00:24:04 26 4
gpt4 key购买 nike

我正在尝试做一些可能不可能的事情,但让我们看看你怎么想。这是我的代码:

html {
background: url(../img/pattern.png) repeat, url(../img/up2.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
background-color: black;
}

所以我试图获取具有多个背景的 html 元素,例如 2,问题是我只想将背景大小设置为第二个背景,而不是第一个背景。有什么想法吗?

最佳答案

您需要重置第一个图像的尺寸,然后为第二个图像指定尺寸。 spec表示background-size的初始值为auto,这意味着:

-webkit-background-size: auto, cover;
-moz-background-size: auto, cover;
-o-background-size: auto, cover;
background-size: auto, cover;

关于CSS3 背景 - 多个背景大小属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16919890/

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