【问题标题】:html Not Found errorhtml未找到错误
【发布时间】:2017-05-08 04:51:31
【问题描述】:

我只是一个html的学生,我只是写了一个简单的代码来学习html.. 我有一个问题。

如果我写代码

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>html practice</title>
</head>
<body>
    move to <a href=google.com" target="_blank"><strong>google</strong></a>
</body>
</html>

这个链接失效了

但是当我将代码更改为&lt;a href="https://www.google.com" target="_blank"&gt; 时,它工作得很好。

我不知道为什么,我很好奇..请帮帮我...

【问题讨论】:

  • 你在google.comhref=google.com" 之前错过了双引号
  • 是的,我错过了。但如果我纠正它,它有相同的结果
  • 你至少需要我认为的协议
  • 这样:move to &lt;a href="http://google.com" target="_blank"&gt;
  • “但是当我将代码更改为 &lt;a href="https://www.google.com" target="_blank"&gt; 时,它运行得非常好。” - 那是因为您拥有大多数浏览器所需的 https://www.

标签: html https http-status-code-404 href


【解决方案1】:

这可能是你的问题

<a href=google.com" target="_blank"><strong>google</strong></a>

注意href???它缺少开头的 "。应该是:

<a href="google.com" target="_blank"><strong>google</strong></a>

【讨论】:

  • 非常感谢!我得到了太多帮助:)
【解决方案2】:

你错过了两件事: 在您错过的 href 中:
- 报价
- http:\
应该是这样的:

<a href="http:\\google.com" target="_blank">

【讨论】:

  • 需要'http'吗?我不认为这不是义务之前
【解决方案3】:

您需要在 google.com 前面加上 http:// 或 https://,否则浏览器会认为它是您的网络服务器上本地保存的文件,而不是外部站点链接。

【讨论】:

  • 谢谢!这对我很有帮助:)
猜你喜欢
  • 2015-11-21
  • 1970-01-01
  • 2020-04-23
  • 2020-11-13
  • 2019-01-08
  • 2012-05-26
  • 2018-11-13
  • 2023-03-11
  • 2018-12-04
相关资源
最近更新 更多