如何建立一个html文件,点击就进入指定的网站

比如说我想整百度的,我用文件另存为把它存在桌面上,点开html文件,地址栏是"C:\Documents and Settings\User\桌面\百度一下,你就知道.htm",怎么编写代码,让一个网页文件点击后就进入网站,地址栏是正确的网址?
在线急等

用记事本打开你那html文件
然后加入
<meta http-equiv="refresh" content="1;url=http://www.baidu.com/">

或者在<body>标签里加入
<body onload="parent.location='http://www.baidu.com'">
温馨提示:内容为网友见解,仅供参考
第1个回答  2009-08-16
建了一个html文件,里面写个链接链到指定的网站,把下面的代码复制到记事本里,另存为后缀名是.html或.htm的文件(如1.html)
<html>
<head>
<title>百度</title>
<script>
function refor()
{
window.location.href="http://www.baidu.com";
}
</script>
</head>
<body onload="refor()">
</body>
</html>
相似回答