Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/71.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.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 背景不在CSS中工作,位置:修复也不工作_Html_Css - Fatal编程技术网

Html 背景不在CSS中工作,位置:修复也不工作

Html 背景不在CSS中工作,位置:修复也不工作,html,css,Html,Css,我尝试在div class=“container fluid”额外的类中放置背景,位置固定…但这不起作用 放置背景图像的唯一方法是直接到HTML。为什么? 另一个问题是位置:固定。我使用这个引导准备使用的代码,就像你在下面的代码中看到的那样,它不起作用,即使我在css中创建了一个新类,但仍然什么都没有,这是怎么回事 例如: 我只是尝试使用相同的代码,但我用了不同的方式,这是我的代码,我希望它能有所帮助。并尝试添加您的代码“.”如: background-image: url(../img/ic

我尝试在
div class=“container fluid”
额外的类中放置背景,位置固定…但这不起作用

放置
背景图像的唯一方法是直接到HTML。为什么?

另一个问题是
位置:固定。我使用这个引导准备使用的代码,就像你在下面的代码中看到的那样,它不起作用,即使我在css中创建了一个新类,但仍然什么都没有,这是怎么回事

例如:


我只是尝试使用相同的代码,但我用了不同的方式,这是我的代码,我希望它能有所帮助。并尝试添加您的代码“.”如:

background-image: url(../img/ico/wedding_videography.png);


<div class="container-fluid position-fixed">
 <img class="ferrari" src="https://auto.ferrari.com/ja_JP/wp- 
  content/uploads/sites/10/2015/02/news-ferrari-580x362.jpg" alt="ferrari">
</div>

 body{
 height: 3000px;
 }

.ferrari{
 background-size: cover;
 }
背景图片:url(../img/ico/widding\u videography.png);
身体{
高度:3000px;
}
.法拉利{
背景尺寸:封面;
}