为什么我的图像不起作用?

发布于 2024-12-21 04:58:59 字数 261 浏览 0 评论 0原文

我刚刚在我的新笔记本电脑上启动了一个新网站,在写入内容后,我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

故事与诗 2024-12-28 04:58:59

位置可能有问题。

dylanbuth.us

您正在告诉浏览器,在与该文件相同的文件夹中,您有一个名为“images”的子文件夹'。在该文件夹中有一个名为“logo.gif”的文件。验证这是否正确。
如果您找不到任何错误,请尝试说明完整位置。这在 Windows 上看起来像

<img src='C:\\User\\Documents\\images\\logo.gif' alt='dylanbuth.us' />

或者在 mac(或 linux)上可能是这样

<img src='/user/home/Documents/images/logo.gif' alt='dylanbuth.us' />

There is probably a problem with the location.

<img src='images/logo.gif' alt='dylanbuth.us' />

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

<img src='C:\\User\\Documents\\images\\logo.gif' alt='dylanbuth.us' />

Or maybe this on mac (or linux)

<img src='/user/home/Documents/images/logo.gif' alt='dylanbuth.us' />
明月松间行 2024-12-28 04:58:59

因此,可以这样想 - Web 服务器创建驱动器的假根,并且许多 Web 开发人员使用相对路径。因此,无论从何处读取页面,都需要一个名为 images 的子目录,其中包含 logo.gif

另一种选择是编辑 HTML 以指向磁盘上文件的确切位置,即

<img src="c:\\foo\\bar\\pic.png"/>

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

<img src="c:\\foo\\bar\\pic.png"/>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文