html - 上传 html 文件后,其损坏的图像

标签 html css web error-handling

我制作了一个工作正常的 html 文件,但在将其上传到某个免费域名托管服务商后,一些图像未加载。 This是网站和this是它应该看起来的样子

<!doctype html>
<html>
<body id="grad1">
<link rel="stylesheet" type="text/css" href="stylenav.css">
<div class="nav" align="right"><font size="4%"><!--NAV BAR-->
    <nav>
            <font size="3%"><a href="main.html" title="Home" class="navb" target="bottom" id="navb1"><b><img src="icons/home.png" height="30%" width="30%" class="invert"></b></a></font>
            <font size="3%"><a href="about.html" class="navb" target="bottom" id="navb2"><b><img src="icons/about.png" height="30%" width="30%" title="About" class="invert"></b></a></font>
            <font size="3%"><a href="gallery.html" class="navb" target="bottom" id="navb3"><b><img src="icons/gallery.png" height="30%" width="30%" title="Gallery" class="invert"></b></a></font>
            <font size="3%"><a href="favorites.html" class="navb" target="bottom" id="navb4"><b><img src="icons/favorites.png" height="30%" width="30%" title="Favorites" class="invert"></b></a></font>
            <font size="3%"><a href="hobbies.html" class="navb" target="bottom" id="navb5"><b><img src="icons/hobbies.svg" height="30%" width="30%" title="Hobbies" class="invert"></b></a></font>
        </font>
    </nav>
        <div align="left" style="margin-top: -5%; color: #eb4979;">
            <img src="images/logo.png" height="40%">
            <font size="10%"><b><span style=" position: absolute; margin-top: 10; text-shadow: 0 0 3px rgba(0, 0, 0, .8)">Dexter Silva</span></b></font>
        </div>
    </div>
</body>
</html>

最佳答案

请检查您所有的文件是否都已上传...例如我找不到

<img src="images/logo.png" height="40%">

images/logo.png 在你的服务器上。

还有 icons/favorites.png 应该在 images/icons/favorites.png 所以它找不到图片。

有些服务器是区分大小写的,所以确保你的 html 能找到它

干得不错,继续努力 提示:您的菜单按钮打开新页面。更好地在同一页面中显示您的内容 尝试类似 https://www.w3schools.com/howto/howto_js_curtain_menu.asp 的东西

关于html - 上传 html 文件后,其损坏的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55073887/

相关文章:

javascript - 自动计算输入字段

javascript - D3js - 无法更改 svg 文本元素的样式

javascript - 尝试使用 JS 在 HTML 中显示 Json 响应

css - 面板包装中的 Bootstrap 菜单

javascript - FullCalendar 插件 3.1.0 显示不正确

javascript - 无法将文字居中放置在图片上

c# - 如何使用 selenium C# 清除 session 存储?

javascript - 如何使 tabindex 在 div 中本地化

language-agnostic - 如何允许匿名信息共享和上传?

android - 将 Web 应用程序部署为移动应用程序