Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/89.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_Bootstrap 4 - Fatal编程技术网

Html 为什么我的背景图像消失/闪烁(引导)?

Html 为什么我的背景图像消失/闪烁(引导)?,html,css,bootstrap-4,Html,Css,Bootstrap 4,我注意到我的网站有一个有趣的问题。我有一个部分,有一个静态的背景图像,当你滚动时,有一个报价和按钮(最终将链接到商店)在它的顶部。据我所知,它在过去是有效的,但昨天我注意到几秒钟后背景图像消失了,取而代之的只是一个灰色背景。图像将在永久替换为灰色背景之前来回闪烁一点 这是我的HTML: <section class="bar background-image-fixed-2 no-mb color-white text-center"> <div class="dark

我注意到我的网站有一个有趣的问题。我有一个部分,有一个静态的背景图像,当你滚动时,有一个报价和按钮(最终将链接到商店)在它的顶部。据我所知,它在过去是有效的,但昨天我注意到几秒钟后背景图像消失了,取而代之的只是一个灰色背景。图像将在永久替换为灰色背景之前来回闪烁一点

这是我的HTML:

<section class="bar background-image-fixed-2 no-mb color-white text-center">
    <div class="dark-mask"></div>
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <div class="icon icon-lg"><i class="fa fa-leaf"></i>
                </div>
                <h3><em>"Herb is the healing of a nation" - Bob Marley</em></h3>
                <p class="text-center">
                    <a href="#" class="btn btn-template-transparent-black btn-lg">Get Some</a>
                </p>
            </div>

        </div>
    </div>
</section>
图像URL是正确的,因为它最初加载几秒钟。最初,这是用速记写的,但我看到一些建议建议对CSS使用长格式。我把它分开了,但这似乎没有什么区别

实际外观(不正确):

预期外观(在自动更改前几秒钟我会看到):

编辑:


(虽然它缺少一些javascript,所以看起来很有趣)。

请检查您的url加载不正确:

.bar.background-image-fixed-2{
背景图像:url('https://images.unsplash.com/photo-1490810277975-e64342ceecf0?ixlib=rb-0.3.5&ixid=eyjhcbfawqiojeymdd9&s=88e69bf894f334456f8ae269752556e1&auto=format&fit=crop&w=1650&q=80’;
背景位置:中心;
背景重复:无重复;
背景附件:固定;
背景尺寸:封面;
}

“药草是一个国家的愈合剂”-鲍勃·马利


ONE LOVE,很抱歉收到垃圾评论。顺便说一句,我正试图修改你的代码。它在所有浏览器上都这样做吗?你能用你的代码举例说明这个问题吗?否则我们就帮不了你了。由于字符限制,我无法添加整个HTML和CSS代码。我使用了该URL,但仍然遇到同样的问题。
.bar.background-image-fixed-2 {
  background-image: url('../img/fixed-background-2.jpg'); 
  background-position: center center;
  background-repeat no-repeat;
  background-attachment: fixed;
  background-size: cover;
}