照片无法加载,链接已消失 [英] Photos won't load and links are dead

查看:61
本文介绍了照片无法加载,链接已消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我将我的网站托管在我的github存储库上netlify上.我在网站上使用过的所有照片和文件都在那里,但是不会加载.只有位于所有文件夹之外的index.html和style.css才会加载.我有一个指向我的github存储库的链接. Github存储库

So I hosted my website on netlify with my github repo. All of my photos and files used in the site are there but they will not load. Only my index.html and style.css that is outside of all of the folders will load. I have a link to my github repo. Github Repo

html{
  background-color:#abb2bc;
}

body{
  margin:0;

}
h1 {
  margin:0;
  background-color: #363b42;
}
img{
  width:250px;
}

.navbar{
  text-align:center;
}

.blogpost{
  background-color:white;
  padding:5%;
  margin:3%

}

#blogheader{
  margin-top:15px;
}

.blogimage{
  margin-top:25px;
}

<!DOCTYPE html>
<html>

<head>
  <title>GamingCoachBlog</title>
  <link rel="stylesheet" type="text/css" href="style.css">
</head>

<body>
  <header>
      <div class="navbar">
        <h1>GamingCoach</h1>
      </div>
  </header>
  <main>
    <div class="blogpost">
      <h2 id="blogheader">Recent Blog Posts</h2>
      <a href="/Users/david/Desktop/Blog/Articles/Ten Fortnite Tips For Season 8/index.html"><img class="blogimage" src="C:/Users/david/Desktop/Blog/Images/How to get more wins in Fortnite.png" alt="How to get more wins in Fortnite"></a>
    </div>
  </main>
</body>

</html>

推荐答案

'C://'引用或本地引用不能在线使用.除此之外,不建议在网页名称和文件名中使用空格,因为某些浏览器可能不支持空格,或者会将空格转换为Web标准,空格或Unicode标准(U + 0020),因此可以对它们执行更多操作.

'C://' refrences, or local refrences, do not work online. Aside from this, using spaces in your webpage name and file name is not recommended, as some browsers may not support spaces or will convert them to the web standard, a '+', or the unicode standard for space (U+0020) so that more actions can be performed on them.

FIX:

交换
src ="C:/Users/david/Desktop/Blog/Images/如何在Fortnite.png中获得更多胜利"

src ="Images/如何在Fortnite.png中获得更多胜利"

Swap
src="C:/Users/david/Desktop/Blog/Images/How to get more wins in Fortnite.png"
with
src="Images/How to get more wins in Fortnite.png"

要解决您的问题并正确渲染照片,前提是您的浏览器不反对空白.

to fix your problem and render the photo correctly, assuming your browser doesn't object to the spaces.

这篇关于照片无法加载,链接已消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆