简体   繁体   English

HTML 相对路径不显示图像

[英]HTML Relative Path Not Showing Image

I have a URL to this link我有这个链接的网址

http://www.weebly.com/editor/uploads/8/5/0/1/85017748/custom_themes/762476756986669176/files/img/home22.jpg

I am trying to use a relative path instead of an actual url.我正在尝试使用相对路径而不是实际的 url。 For some reason when I do this出于某种原因,当我这样做时

<div class="background-image-holder">
     <img alt="image" class="background-image" src="files/img/home22.jpg">
</div>

The image doesn't show, but when I use a url it shows just fine.图像不显示,但是当我使用 url 时,它显示得很好。 Any ideas on what I am doing wrong?关于我做错了什么的任何想法? I've also tried ../files/img/home22.jpg and img/home22.jpg but neither worked.我也试过../files/img/home22.jpgimg/home22.jpg但都没有奏效。

Clearly you have a problem with your relative path, the easiet solution to fix this, is to inspect your html code and see what is the path set after that you can figure out which part of the URL you are missing.很明显,您的相对路径有问题,解决此问题的简单解决方案是检查您的 html 代码,然后查看设置的路径是什么,然后您可以找出缺少的 URL 部分。 We can't really help you with the exact relative path you need, because we don't know which system CMS or Framework you are using ..我们无法真正为您提供所需的确切相对路径,因为我们不知道您使用的是哪个系统 CMS 或框架。

To inspect your HTML code, open your website in google chrome or firefox (you can use firebug ) and right click => Inspect Element要检查您的 HTML 代码,请在 google chrome 或 firefox 中打开您的网站(您可以使用firebug )并右键单击 => Inspect Element

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

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