How do i create and link another webpage with Visual Studio Code?

青春壹個敷衍的年華 提交于 2021-02-05 12:20:15

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!