问题
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?
Do I have to code all the pages in the same index.html file? Or do I need to create another html?
回答1:
Or do I need to create another 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
The <a> element is used to create links between pages.
<a href="url-of-other-page.html">Other page</a>
来源:https://stackoverflow.com/questions/59731709/how-do-i-create-and-link-another-webpage-with-visual-studio-code