Home > Back-end >  Can't navigate to linked pages with live server
Can't navigate to linked pages with live server

Time:08-28

this is my first time attempting to add a second page to the same site. I am having trouble navigating to a second page when using the live server extension in VS Code.

<div > <a href="\test.html" target="_self">TEST</a> </div>

File Structure

First time posting on stackoverflow, so please pardon me for the mistake I likely made.

CodePudding user response:

Here all the files are in same directory so just filename in href attribute is enough. And one more thing, you need to use / not \ if you want to access files in sub directories

<a href="test.html" target="_self">TEST</a>
<a href="dir/test.html" target="_self">TEST</a>
  • Related