I'm learning HTML and am currently building a simple web page that includes a link to another file in the same folder. Everything looks fine with the link, but when I try to left-click it, nothing happens. Interestingly, it does open if I right-click and select 'open in a new window'. This makes me think my href is correct, but I'm puzzled about why left click isn't working. I've shared my code below, which is all I've got so far. I'm testing it in Firefox. Can someone explain what might be going wrong?
2 Answers
It seems like you have duplicated your HTML code which isn’t necessary. But the main issue is that your href has an absolute file path. Browsers tend to block these for security reasons, so left-clicks won't work on them. The good news is that if both your HTML files are in the same folder, you can use a relative path instead. Just replace your href with something simple like `href="Untitled-1.html"` and it should work fine!
You're really on the right track here! The issue you’re having is all about the difference between absolute and relative paths. Your link has an absolute path which gives the full directory, leading Firefox to block it. Instead, just link to the file name since both files are in the same directory. So, your code should look like this: `href="Untitled-1.html"`. That should resolve your issue!
That makes sense! I didn’t realize it was a security feature either. Thanks for the clear explanation!

Absolutely! That change should make your link clickable. Browsers aren't fans of absolute paths like the one you used because they can pose security risks. Relatives are much safer and just as effective!