如何获取背景图像以显示在我的github页面上?

时间:2019-02-17 02:12:24

标签: html css github-pages

总结

我试图将video.gif显示在github页面的背景中,但是由于某种原因它仅在本地显示。已经为此进行了2多个小时的尝试,但仍然无法正常工作。

这是我到目前为止尝试过的。

+ background-image: url("../gifs/video.gif"); - Doesn't work
+ background-image: url('../gifs/video.gif'); - Doesn't work
+ background-image: url('https://media.githubusercontent.com/media/JackTimelessPiece/Website/master/gifs/video.gif'); - Work Locally
+ background-image: url('gifs/video/gif'); - Work Locally

这是我当前的CSS代码

body {
    background-image: 
url('https://media.githubusercontent.com/media/JackTimelessPiece/Website/master/gifs/video.gif');
    background-repeat: no-repeat;
    background-size: 100% 100%;
    margin: 0 0 100px; /* bottom = footer height 

    }

我的结果

我只有url('gifs/video.gif')url('https://media.githubusercontent.com/media/JackTimelessPiece/Website/master/gifs/video.gif')在本地工作,由于某种原因,它们无法在github页面上工作。

更新

显然,我只是将背景图像代码移到了index.html上,并以某种方式修复了要加载的gif。感谢您的帮助!

0 个答案:

没有答案
相关问题