简体   繁体   English

为什么我来自 url 的图片没有显示?

[英]Why isn't my image from url not showing up?

Why isn't my image showing up with the url I'm using?为什么我使用的 url 没有显示我的图像? The url is valid and I used the same method to insert other images and it worked. url 是有效的,我使用相同的方法插入其他图像并且有效。 First code is the url that isn't showing up and the other one are the images that are showing up.第一个代码是未显示的 url,另一个是显示的图像。 I have also included the images of what appears on the webpage for the unresponsive image as well as the responsive one.我还包括了网页上出现的无响应图像和响应图像的图像。

 <div>
      <img src=”https://via.placeholder.com/150/0000FF/808080” alt="Profile Pic" /> 
      <h1 id="myname">John Smith</h1>
      <h3>Web developer</h3>
      <p>{{ pause and ponder }}</p>
    </div>
      </div class="intro">
 <div class="project-grid">
      <img class="project-image" src="http://via.placeholder.com/300" />
      <img class="project-image" src="http://via.placeholder.com/300" />
      <img class="project-image" src="http://via.placeholder.com/300" />
      <img class="project-image" src="http://via.placeholder.com/300" />
    </div>

I don't understand what the issue I did the exact same thing for both but only the second group of images is showing up on my webpage.我不明白我对两者做了完全相同的事情是什么问题,但只有第二组图像显示在我的网页上。

You used "https://...." for the profile picture, but if your development server is on "http://...", then the profile picture won't show up due to cross-protocol restrictions.您使用“https://....”作为个人资料图片,但如果您的开发服务器位于“http://...”上,则由于跨协议限制,个人资料图片将不会显示。

Change <img src=”https://via.placeholder.com/150/0000FF/808080” alt="Profile Pic" /> to <img src=”http://via.placeholder.com/150/0000FF/808080” alt="Profile Pic" /><img src=”https://via.placeholder.com/150/0000FF/808080” alt="Profile Pic" />更改为<img src=”http://via.placeholder.com/150/0000FF/808080” alt="Profile Pic" />

You've got special character quote marks instead of regular ones surrounding the src attribute.您在src属性周围使用了特殊字符引号而不是常规引号。

Change the character to " . Most likely it was converted in something like Word or Outlook.字符更改为" 。它很可能是在 Word 或 Outlook 之类的东西中转换的。

Fixed HTML:固定 HTML:

<img src="https://via.placeholder.com/150/0000FF/808080" alt="Profile Pic" /> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM