Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 使用Href打开本地文件URL_Html_Localhost - Fatal编程技术网

Html 使用Href打开本地文件URL

Html 使用Href打开本地文件URL,html,localhost,Html,Localhost,我的电脑上有一个.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%2

我的电脑上有一个.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


感谢您的帮助

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

正确的超链接:

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


add
http://
www.google.com
前面,很高兴你发现我的答案很有用。如果你能接受我的答案,如果它能解决你的问题,那就太好了:)我会的,需要等7分钟!