为什么我的图像不起作用?
我刚刚在我的新笔记本电脑上启动了一个新网站,在写入内容后,我在 Google Chrome 上检查了它。我的图像都不起作用。网址都很好,但就是不起作用。我的代码如下。我觉得有点愚蠢,因为这可能是非常简单的事情。让我知道你的想法。谢谢!
<img src='images/logo.gif' alt='dylanbuth.us' />
我有一台 64 位电脑和 32 位 chrome。这有关系吗?我不这么认为,但也许还是彻底的。
I just started a new site on my new laptop and after writing in the content i checked it on Google Chrome. None of my images worked. The urls are all good but it's just not working. My code is below. I feel kinda dumb cause it's probably gonna be something really simple. Let me know what you think. Thanks!
<img src='images/logo.gif' alt='dylanbuth.us' />
I have a 64bit computer and 32bit chrome. Does that matter? I don't think so but might as well be thorough.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
位置可能有问题。
您正在告诉浏览器,在与该文件相同的文件夹中,您有一个名为“images”的子文件夹'。在该文件夹中有一个名为“logo.gif”的文件。验证这是否正确。
如果您找不到任何错误,请尝试说明完整位置。这在 Windows 上看起来像
或者在 mac(或 linux)上可能是这样
There is probably a problem with the location.
You are telling a browser that in the same folder as the file, you have a subfolder called 'images'. In that folder you have a file called 'logo.gif'. Verify that this is correct.
If you can't find anything wrong, try stating the full location. This would look something like on windows
Or maybe this on mac (or linux)
因此,可以这样想 - Web 服务器创建驱动器的假根,并且许多 Web 开发人员使用相对路径。因此,无论从何处读取页面,都需要一个名为 images 的子目录,其中包含 logo.gif
另一种选择是编辑 HTML 以指向磁盘上文件的确切位置,即
So think of it like this - a web server creates a fake root of a drive and a lot of web developers use relative paths. So where ever the page is read from it is expecting a sub directory called images that contains logo.gif
The other alternative is to edit the HTML to point to exact locations on you disk for files ie