【问题标题】:Image doesn't get displayed in bootstrap thumbnail图像未显示在引导缩略图中
【发布时间】:2015-10-09 17:37:36
【问题描述】:

在我的网站上,我试图用他们的徽标、他们的名字和关于他们的简短描述来概述客户。

我正在使用引导缩略图和 chrome。

这是我的代码:

<div class="row">
    <div class="col-sm-6 col-md-4">
        <div class="thumbnail">
            <img src="/img/logos/first.jpg" alt="first">
            <div class="caption">
                <h3>First</h3>
                <p>Some text</p>
            </div>
        </div>
    </div>
    <div class="col-sm-6 col-md-4">
        <div class="thumbnail">
            <img src="/img/logos/second.png" alt="second">
            <div class="caption">
                <h3>Second</h3>
                <p>Some text</p>
            </div>
        </div>
    </div>
    <div class="col-sm-6 col-md-4">
        <div class="thumbnail">
            <img src="/img/logos/third.png" alt="third">
            <div class="caption">
                <h3>Third</h3>
                <p>Some text</p>
            </div>
        </div>
    </div>
</div>

我的问题是我看不到任何图像。我得到的只是替代文本。图片的路径是正确的。

谁能解释一下为什么我的图片不显示?

编辑:

这是我的项目结构:

解决方案

我发现了错误!

  • 正确的路径是“img/logos/first.jpg”。
  • 我还使用“sudo chmod 755 FILENAME”(Linux)修改了文件夹徽标和所有图像。

【问题讨论】:

  • 控制台中有任何 404 错误吗? (路径真的正确吗?)
  • 显然你的标记很好。 jsfiddle.net/t5y3onx4
  • 你能截图你的文件夹结构吗?图像所在的文件夹不正确可能是一个问题。如果正确,请尝试验证图像和文件夹。
  • 它实际上应该与img/Kundenlogos/first.jpg 一起工作您可能会检查文件类型是否正确(您的结构中有.png)以及拼写是否正确。如果这不起作用,请检查您的浏览器是否正在缓存图像。

标签: html twitter-bootstrap thumbnails


【解决方案1】:

路径/img/Kundenlogos/third.png 是相对于您的根目录的。例如,您可能有类似 /Webseite/img/Kundenlogos/third.png 的东西。也包括在内。

如果你的结构是这样的:

folder
    html
        file.html
        index.html
    img
        Kundenbilder
            first.jpg
            second.jpg

你也可以使用../img/Kundenlogos/third.png

【讨论】:

    猜你喜欢
    • 2013-01-29
    • 1970-01-01
    • 2016-06-13
    • 2021-08-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-13
    相关资源
    最近更新 更多