我只是一名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>
这个链接不起作用
但是当我将代码更改为<a href="https://www.google.com" target="_blank">
时,它的效果非常好。
我不知道为什么,我很好奇..请帮助我......
答案 0 :(得分:1)
您需要在google.com前面使用http://或https://,否则浏览器会认为它是在您的网络服务器上本地保存的文件,而不是外部网站链接。
答案 1 :(得分:-1)
这可能是你的问题
<a href=google.com" target="_blank"><strong>google</strong></a>
注意href ???它错过了&#34;在开始。它应该是:
<a href="google.com" target="_blank"><strong>google</strong></a>
答案 2 :(得分:-1)
你错过了两件事:
在你错过的href:
- 报价
- http:\
应该是这样的:
<a href="http:\\google.com" target="_blank">