当前,我正在在线学习使用1个index.html文件和1个app.js文件的教程,这些文件仅占1页.但是,我想有多个页面,只需单击一个按钮就可以来回链接,我如何有多个页面?
Currently I am following tutorials online that uses 1 index.html file, and 1 app.js file that results in only 1 page. However I would like to have multiple pages, that links back and forth with a click of a button, how do I have multiple pages?
我是否必须将所有页面编码在同一个index.html文件中?还是我需要创建另一个html?
Do I have to code all the pages in the same index.html file? Or do I need to create another html?
推荐答案
还是我需要创建另一个html?
Or do I need to create another html?
是的.除非您正在构建SPA或使用服务器端代码动态生成HTML,否则:每个HTML文件都是一个页面.
Yes. Unless you are building a SPA or dynamically generating your HTML with server side code: Each HTML file is a page.
通过单击按钮来回链接
that links back and forth with a click of a button
< a> 元素用于在页面之间创建链接.
The <a> element is used to create links between pages.
<a href="url-of-other-page.html">Other page</a>更多推荐
如何使用Visual Studio Code创建和链接另一个网页?
发布评论