douzi9211 2017-10-16 06:31
浏览 77
已采纳

在Heroku上托管的PHP应用程序的一些图像没有被加载

I am using Github as SCM & have enable auto-deploy on Heroku. I am trying Heroku for a simple HTML, CSS, JS app & Used PHP for deployment. All my images are available in Git, relative path given for images is also correct. Still some of the images are not reflecting on page & giving 404 whereas most of them do appear. What can be it's reason?

Here's code snippet

.bgimg1 {
            background-image: url('images/Top_Image.jpg');
        }
<body class="background">
    <div class="loader"></div>
    <div class=" bgimg1">My top content </div>

<div class="carousel-inner" role="listbox">
                <div class="item active">
                    <img src="images/1.jpg" alt="img" height="50%" width="100%">
                </div>
                <div class="item">
                    <img src="images/2.jpg" alt="img" height="50%" width="100%">
                </div> 
            </div>
</body>

and here is project structure. enter image description here

</div>
  • 写回答

1条回答 默认 最新

  • dongye8110 2017-10-16 07:22
    关注

    Make sure you reference the correct images, watch out for lower/upper case: You are referencing *.jpg (lower case) in your html when the filenames really are .JPG (upper case).

    Corrected code:

    .bgimg1 {
      background-image: url('images/Top_Image.JPG');
    }
    
    <body class="background">
      <div class="loader"></div>
      <div class=" bgimg1">My top content </div>
      <div class="carousel-inner" role="listbox">
        <div class="item active">
          <img src="images/1.JPG" alt="img" height="50%" width="100%">
        </div>
        <div class="item">
          <img src="images/2.jpg" alt="img" height="50%" width="100%">
        </div> 
      </div>
    </body>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效