本文摘自PHP中文网,作者coldplay.xixi,侵删。
html实现页面跳转的方法:1、通过meta设置跳转时间和页面;2、使用a标签直接跳转;3、通过javascript中实现跳转,代码为【window.location.href='index.html'】。

本教程操作环境:windows7系统、html5版,DELL G3电脑。
html实现页面跳转的方法:
1、html中使用meta中跳转,通过meta可以设置跳转时间和页面
1 2 3 4 5 6 | <head>
<!--只是刷新不跳转到其他页面 -->
<meta http-equiv="refresh" content="5">
<!--定时转到其他页面 -->
<meta http-equiv="refresh" content="5;url=index.html">
</head>
|
2、a标签直接跳转
1 | <a href="http://baidu.com">百度一下</a>
|
3、通过javascript中实现跳转
1 2 3 4 5 6 | window.location.href='index.html';
setTimeout("javascript:location.href='index.html'", 5000);
其实两种方式是类似的,只是有的在javascript中写的跳转,另一种直接从html中写跳转
<button id="load" οnclick="window.location.reload('/html/index.html')">跳转</button>
|
4、html跳转上一页的方式
阅读剩余部分
相关阅读 >>
jsp和Html之间有什么区别
Html的正式名称是什么?
如何理解Html、css、javascript之间的关系?
Html和css是什么语言?
Html article标签怎么用
Html aside标签怎么用
Html audio标签怎么用
Html b标签怎么用
Html base标签怎么用
Html bdi标签怎么用
更多相关阅读请进入《Html》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » html如何实现页面跳转