【问题标题】:Local file open URL with Href带有 Href 的本地文件打开 URL
【发布时间】:2015-10-14 22:07:35
【问题描述】:

我的计算机上有一个 .html 文件(本地),我只想拥有一个按钮或超链接。

所以我做了这样的事情:

超链接:

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

按钮:

<button href="www.google.com">test</button>

但它不起作用,因为这个打开的 Url 像: file:///C:/Users/Cyril/Documents/visual%20studio%202013/Projects/MyProject/www.google.com

我怎样才能只打开 www.google.com ?

谢谢你的帮助

【问题讨论】:

  • 在www.google.com前面添加http://

标签: html localhost


【解决方案1】:

src 属性中的 url 地址之前缺少 http。而不是www.google.com,你应该有http://www.google.com

正确的超链接:

<a href="http://www.google.com" target="_blank">test</a>

【讨论】:

  • 很高兴您发现我的回答很有帮助。如果它解决了你的问题,如果你能接受我的回答,那就太好了:)
  • 我会的,需要等7分钟!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-12-04
  • 2023-02-14
  • 1970-01-01
  • 2019-11-26
  • 2010-09-20
  • 1970-01-01
相关资源
最近更新 更多