javascript - HTML/CSS/JS 图像未在线加载

标签 javascript html css http-status-code-404 hosting

当我上传文件时,我网站的某个部分的图像没有加载。当我在本地检查它们时,一切正常。我在 js 控制台中收到此错误代码。

Failed to load resource: the server responded with a status of 404 (Not Found)

这只会发生在同一部分的六张图片上。所有其他图像都可以正常加载。我检查了路径,这似乎不是问题所在。我以添加了三个 300x200 图像为例,并保持 3 个图像相同。

/*------ Basic Setup ------*/

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: white;
  color: #fff;
  font-family: 'Raleway', 'Lato', 'Arial', sans-serif;
  font-weight: normal;
  font-size: 20px;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

.clearfix {
  zoom: 1
}

.clearfix:after {
  content: '.';
  clear: both;
  display: block;
  height: 0;
  visibility: hidden;
}

.row {
  max-width: 1140px;
  margin: 0 auto;
}


/*------ Dividers ------*/

.divider {
  width: 25%;
  height: 30px;
  border-bottom: 1px solid rgba(89, 89, 89, 0.65);
  text-align: center;
  margin: auto;
  margin-bottom: 4%;
}

.divider span {
  font-size: 200%;
  background-color: white;
  padding: 0 10px;
}


/*------ Team Section ------*/

.team {
  background-color: white;
  padding-bottom: 1%;
}

.team-content {
  color: grey;
  text-align: center;
}

.team h1 {
  margin-bottom: 0;
}

.team .description {
  margin-top: -2.5%;
  margin-bottom: 4%;
}

.team-pics {
  margin-bottom: 2%;
}

.team-content p {
  padding-left: 5%;
  padding-right: 5%;
}
<html>

<head>
  <link href="https://fonts.googleapis.com/css?family=Raleway:300,400,500,600,700" rel="stylesheet">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
  <link rel="stylesheet" href="http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
  <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
  <link rel="stylesheet" href="css/normalize.css">
  <!--Favicon-->
  <link rel="apple-touch-icon" sizes="180x180" href="images/favicons/apple-touch-icon.png">
  <link rel="icon" type="image/png" href="images/favicons/favicon-32x32.png" sizes="32x32">
  <link rel="icon" type="image/png" href="images/favicons/favicon-16x16.png" sizes="16x16">
  <link rel="manifest" href="images/favicons/manifest.json">
  <link rel="mask-icon" href="images/favicons/safari-pinned-tab.svg" color="#5bbad5">
  <meta name="theme-color" content="#ffffff">
  <!--Favicon-->
</head>

<body>
  <section class="team" id="team">
    <div class="team-content">
      <h1>Our Team</h1>
      <div class="divider d2">
        <span><i class="fa fa-paw" aria-hidden="true"></i></span>
      </div>
      <div class="col-lg-12 description">
        <p>The German Shepherd Foundation is comprised of people with so much passion for German Shepherds.</p>
        <p>You will not find any other orginazation with our passion and expertise.</p>
      </div>
      <div class="row team-pics">
        <div class="col-xs-6 .col-sm-6 col-md-6 col-lg-4">
          <img src="images/john.jpg" alt="John" class="img-responsive">
          <p>Founder - John</p>
        </div>
        <div class="col-xs-6 .col-sm-6 col-md-6 col-lg-4">
          <img src="images/sam.jpg" alt="Sam" class="img-responsive">
          <p>Head of Puppy Care - Sam</p>
        </div>
        <div class="col-xs-6 .col-sm-6 col-md-6 col-lg-4">
          <img src="images/adam.jpg" alt="Adam" class="img-responsive">
          <p>Veterinarian - Adam</p>
        </div>


        <div class="col-xs-6 .col-sm-6 col-md-6 col-lg-4">
          <img src="http://www.pestworld.org/media/1030/300x200.gif" alt="Blair" class="img-responsive">
          <p>Transtion Specialist - Blair</p>
        </div>
        <div class="col-xs-6 .col-sm-6 col-md-6 col-lg-4">
          <img src="http://www.pestworld.org/media/1030/300x200.gif" alt="Jack" class="img-responsive">
          <p>Grooming Expert - Jack</p>
        </div>
        <div class="col-xs-6 .col-sm-6 col-md-6 col-lg-4">
          <img src="http://www.pestworld.org/media/1030/300x200.gif" alt="Tammy" class="img-responsive">
          <p>Dietitian - Tammy</p>
        </div>

      </div>
      <div class="col-lg-12 description">
        <br><br><br>
        <p>Intrested in joining our crack team of dog experts?</p>
      </div>
    </div>
  </section>
</body>

</html>

最佳答案

请检查图像文件夹及其内容的访问设置。 您可能需要在它不工作的服务器上设置对所有的读取权限。

关于javascript - HTML/CSS/JS 图像未在线加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42265139/

相关文章:

javascript - 突出显示 Three.js 中的 THREE.Line

javascript - 为什么我的 Django 异常处理不起作用

滚动时 JavaScript 数字发生变化

javascript - Node js应用程序加载资源失败

javascript - 从数组中检索的 var 未定义?

javascript - 删除其他网站上的 cookie

javascript - 为什么我的 Javascript 变量没有初始化?

javascript - 动画 Canvas 描边

html - 应用于特定 DIV 的 CSS 会遗漏一些细节

css - 像边距或填充之类的东西,除了不绘制背景的地方