对于我的投资组合网站,我的背景图片有一个gif。几周没事,但现在已经停止工作。我尝试放入其他GIF。在我的本地计算机上看起来不错,但是当推送到我的主机时,它不再起作用。不知道是什么问题使它出现在我的计算机上,而不是在托管时出现。

When it's working properly on my machine - see the triangles?

When it's not working on the actual website

该站点位于http://www.KimberlyScarabello.com

我可以肯定我正确地更新了文件,因为其他更改显示得很好。这是我正在使用的CSS。我已经尝试过将gif保存到我的本地计算机上,并将文件路径放在url中,但这没有用(尽管它也可以在我的计算机上使用)。

#wrapper > .bg {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: #212931;
        background-image: url('https://media.giphy.com/media/xTg8BbPcaAP43oVyeY/giphy.gif'), linear-gradient(0deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1));
        background-size: cover,                             auto,                                                       100% auto;
        background-position: center,                                center,                                                     top center;
        background-repeat: repeat,                              no-repeat,                                                  no-repeat;
        background-attachment: scroll,                              scroll,                                                     scroll;
        z-index: -1;
        filter: brightness(10%)
    }

最佳答案

对我来说很好。

这很可能是由您的缓存引起的。每当您遇到此类问题时,只需使用ctr + f5(我认为适用于Mac的cmd + shift + r)来重新加载您的网站即可。让我知道这是否不适合您。

关于html - CSS-背景图片显示在我的计算机上,而不显示在我网站的托管版本中……为什么?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/47583439/

10-11 04:33
查看更多