html - 为什么 html 中的超链接无法重新定位到其他页面?

标签 html css hyperlink navigation

下面是尝试使用菜单将页面链接在一起。

<html>

<head>

  <title>Home</title>
  <link href="index.css" rel="stylesheet" type="text/css">

</head>

<body>

  <header>

    <article id="logo_section">

      <img src="webpage_logo.png" alt="logo.png">

    </article>

  </header>

  <nav>

    <ul>
      <li><a href="index.html">Home</a>
      </li>
      <li><a href="gallery.html">Gallery</a>
      </li>
      <li><a href="about_us.html">About Us</a>
      </li>
      <li><a href="contact_us.html">Contact us</a>
      </li>
    </ul>

  </nav>

</body>

</html>

我的想法是在导航栏和 Logo 中将页面链接在一起。

All of the HTML pages are within the same folder and they are spelt correctly in the references. I checked.

最佳答案

首先,您的链接代码没有问题,所以一切都指向您忘记在同一目录中创建文件,或者根本没有创建文件。 此外,您还没有声明您的文档(在页面顶部使用完成),因此浏览器将假定它是 html 4.01,并且由于它是 html 5 中的新内容,所以您的 nav 标签没有做任何事情,我可以提及更多错误,但您可以在此处自行找到它们:https://validator.w3.org/#validate_by_input

关于html - 为什么 html 中的超链接无法重新定位到其他页面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37117590/

相关文章:

javascript - getImageData 导致 "Uncaught Error: NOT_SUPPORTED_ERR: DOM Exception 9"

html - 每隔一段时间缩放 float div

hyperlink - font-awesome 链接使图标变成蓝色。你如何改变这种颜色?

php - 如何使用 ajax jquery 和 php 为多表单流程制作动画?

TextBlock : nothing happens when I click on it 中的 C# 超链接

javascript - 从页面获取链接并将其显示在表格中?

html - 简单边距属性在 IE 和 FireFox 中正确显示,但在 Chrome 中不正确

jquery - 使用 jquery 附加到 <head> 时不应用 .less 样式,但 .css 有效

javascript - 如何在createjs中屏蔽视频

html - Angular 2 CLI 元素中的 Bootstrap 4 按钮间距