【问题标题】:Why my images are not displaying in my Git Hub Pages?为什么我的图片没有显示在我的 Github 页面中?
【发布时间】:2020-08-14 14:33:27
【问题描述】:

我刚刚构建了这个 github 页面,但是由于某种原因,我的图片没有与页面一起加载。

这里是my site的链接

这是我的repo

请注意,我将所有图像都放在了一个名为“_imagens”的文档中,并且我在我的文档中正确地调用了它。

无论如何,这里是我调用我的图像的地方

在第一页:

/*Configuracoes da imagem de fundo*/
body {
    background-image: linear-gradient(rgba(0,0,0,0.5),rgba(0,0,0,0.5)) ,url("_imagens/fundo.jpg");    
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    background-position: center center;

    height: 100vh;

    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;

}

在第二页:

<header id="cabecalho">
            <img src="_imagens/poli.png" width="75px"  id="poli">
            <h1>
                Notas Poli
            </h1>
            <img src="_imagens/chapeu.png" width="75px" id="chapeu">
        </header>

它们在我的计算机上运行良好,所以我认为这是我在 github 上所做的,但我不知道会是什么。

【问题讨论】:

    标签: html css github github-pages


    【解决方案1】:

    我之前提到过using a relative path,所以试试:

    <img src="./_imagens/chapeu.png" width="75px" id="chapeu">
    

    或者

    <img src="./projeto poli junior/_imagens/chapeu.png" width="75px" id="chapeu">
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-02-07
      • 2018-07-07
      • 2014-10-25
      • 2021-06-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多