Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 修复了使用淡入动画时背景附件不工作的问题?_Html_Css - Fatal编程技术网

Html 修复了使用淡入动画时背景附件不工作的问题?

Html 修复了使用淡入动画时背景附件不工作的问题?,html,css,Html,Css,我正在为我的网站使用淡入动画,我尝试在css中实现后台附件:fixed属性,但是它对我来说没有任何改变。我有一种感觉,这与我的动画淡入有关,但我真的不确定。以下是我的容器类和主体: body { animation: fadeInAnimation ease 3s; animation-iteration-count: 1; animation-fill-mode: forwards; background-image: url(images/backgr

我正在为我的网站使用淡入动画,我尝试在css中实现
后台附件:fixed
属性,但是它对我来说没有任何改变。我有一种感觉,这与我的动画淡入有关,但我真的不确定。以下是我的容器类和主体:

body { 
    animation: fadeInAnimation ease 3s; 
    animation-iteration-count: 1; 
    animation-fill-mode: forwards; 
    background-image: url(images/background.png);
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
} 
.container{
    height: 100vh;
    width: 100%;
    padding-left: 5%;
    padding-right: 5%;
    box-sizing: border-box;
}
html {
    background-color: black;
}
请通过代码段函数创建一个。