html - 为什么图像不会加载到使用 html 和 css 的网站的移动版本上?

标签 html css image twitter-bootstrap-3 jpeg

我笔上的图像http://codepen.io/niffyy/pen/GNzpNW?editors=1100不会加载到移动屏幕上。

 <div class="row">
<div class="container" id="third">
       <p class="para2"> Portfolio </p>
     <div class="col-xs-6 col-md-6">
      <div><a href='http://codepen.io/niffyy/full/VPZLpj/' class="thumbnail"><img src="http://i.imgur.com/YiCHp7M.jpg" alt="screenshot"></a><h5>Simple Nelson Mandela Tribute Page</h5> 
      </div>

       <div><a href='#' class="thumbnail"><img src="http://i.imgur.com/mMJs4kq.png" alt="screenshot3"></a><h5> Coming soon!</h5>
</div> 

   </div>

      <div class="col-xs-6 col-md-6">
        <div><a href='http://codepen.io/niffyy/full/GNzpNW/' class="thumbnail"><img src="http://i.imgur.com/z5PtrqQ.jpg" alt="screenshot1"></a><h5> Portfolio Page</h5>
  </div> 

      <div><a href='#' class="thumbnail"><img src="http://i.imgur.com/mMJs4kq.png" alt="screenshot2"></a><h5> Coming soon!</h5>
</div>



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



 <div class="col-xs-6"> <img class="img-responsive" id="me" alt="a picture of me" src="http://i.imgur.com/EWx1Z9x.jpg">
      </div>

<--CSS-->

#me{
    width:100%; 
    height: auto;

  margin-top:45px;
  margin-bottom:30px;
  border-style: solid;
  border-width:5px;
  border-radius:20px;
  border-color:#FF33CC;
}

我尝试将格式从 png 更改为 jpeg 并在上传之前调整图像大小,但它仍然不起作用这也适用于网站上的缩略图,我不确定为什么。我检查了代码是否有错误,但没有看到我哪里出错了。它在桌面上显示良好。

最佳答案

我使用 imgur.com 托管我的图像,然后热链接到我的页面。这不符合他们的使用条款,这就是图像未加载到我的页面上的原因。将来如果有人遇到与我相同的问题,请检查您尝试用于页面的图像是否允许热链接。我将托管站点切换到另一个站点,现在我的图片可以正常工作了。

来自 Imgur 使用条款:

'We allow hotlinking on forums, but hotlinked images cannot be used as content for a website, including blog posts, avatars, site elements, and advertising. You can read our terms of service for more info

关于html - 为什么图像不会加载到使用 html 和 css 的网站的移动版本上?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41417922/

相关文章:

html - Firefox 不显示来自缓存的图像仅替代文本

html - 仅在 IE 中出现 CSS 边距问题

css - Stack Overflow-like JavaScript 警告和 w3c HTML 验证

java - 水平或垂直翻转位图图像

javascript - 使用 JavaScript 获取 CSS 背景图像的大小?

html - 如何使 html 中的图像变暗(不是 css)

html - 我在一个 div 中有 2 个盒子,在另一个 div 中有另外 4 个盒子。我需要它们居中但找不到解决方案

jquery - 如何使用jquery在html表中的tbody的最后一个td的最后一个td上设置事件

html - 为什么图像的最大高度适用于除 Firefox 以外的所有浏览器?

css - 如何在@font-face url 中使用 css 变量