【问题标题】:Image not showing up in html live site图片未显示在 html 实时站点中
【发布时间】:2016-09-29 19:39:42
【问题描述】:

我有一个正在忙于创建的网站,但是当我实时上传我的网站时,一张图片没有显示。这是代码

<div id="adbox">
            <div class="clearfix">
                <img src="images/family-large.jpg" alt="Img" height="382" width="594">
                <div class="detail">
                    <h1>Implementing Strategic and Effective Legal Solutions</h1>   
                </div>
            </div>
        </div>

css如下

    .clearfix {
    width: 960px;
    margin: 0 auto;
    }

    .clearfix:after {
        clear:both;
        content:"";
        display:block;
        line-height:0;
        height:100%;
    }

This is what it shows What it suppose to show

【问题讨论】:

  • 很可能是路径问题。尝试“/images/family-large.jpg”并检查 Firebug(或类似)中的图像路径
  • 发送图片未加载页面的url
  • 我认为src 应该是../images/family-large.jpg
  • 检查图像路径或出于测试目的将绝对图像路径放入标签

标签: html css


【解决方案1】:

您的图片路径不正确。您可以通过加载您知道可行的图像来轻松测试这一点。 Lorem Flickr 非常适合测试这个:

.clearfix {
width: 960px;
margin: 0 auto;
}

.clearfix:after {
    clear:both;
    content:"";
    display:block;
    line-height:0;
    height:100%;
}
<div id="adbox">
  <div class="clearfix">
    <img src="http://www.loremflickr.com/382/594" alt="Img" height="382" width="594">
    <div class="detail">
      <h1>Implementing Strategic and Effective Legal Solutions</h1>

    </div>
  </div>
</div>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-11-29
    • 1970-01-01
    • 2018-11-29
    • 2016-10-07
    • 1970-01-01
    • 2015-12-16
    • 1970-01-01
    相关资源
    最近更新 更多