Why are some of my internal HTML links working and others not?

Help, I am completely unfamiliar with this world.

I am making a menu bar on the first page with links to other pages on the site, here is some sample code:

<ul id="menu">
<li><a href="file:///Users/tamborine/Downloads/about_page.htm">About</a></li>
<li><a href="file:///Users/tamborine/Downloads/the_therapist_page.html">The Therapist</a></li>
<li><a href="file:///Users/tamborine/Downloads/pay_what_you_can_page.htm">Pay what you can</a></li>
<li><a href="file:///Users/tamborine/Downloads/projects_we_support_page.htm">Projects we support</a></li>
<li><a href="file:///Users/tamborine/Downloads/resources_page">Resources</a></li>
<li><a href="file:///Users/tamborine/Downloads/prices_page">Prices</a></li>
<li><a href="file:///Users/tamborine/Downloads/faq_page.htm">FAQ</a></li>
</ul>

      

When I open only the first link in the browser (About the program), the others show "File not found" in the browser

I searched forums and checked an element showing strange characters not present in html. I think a coding error? I am using TextEdit for Mac. I tried playing with the TextEdit settings, the file format is plain text, the encoding was checked with UTF-8 and ASCII but no change.

I was on another computer before using notepad and Internet Explorer when I made the first page (About) which is the only link that actually works now. I am now on mac, with TextEdit and Firefox.

Ideas? Thank you.

+3


source to share


4 answers


You have smart quotes "

"

in all but the first link. These smart quotes are considered part of the URL, causing the browser to incorrectly resolve your URLs.



Make sure OS X doesn't automatically convert your double quotes to smart double quotes as you type them. This can happen even if TextEdit is in text mode. Go to Edit> Substitutions in TextEdit and make sure Smart Quotes are not checked. You can also turn off this system-wide system in System Preferences> Keyboard> Text> Use smart quotes and dashes . You can also choose a full featured source editor like Sublime Text instead of using TextEdit.

+2


source


You are missing .htm / .html

in links



<ul id="menu">
<li><a href="file:///Users/tamborine/Downloads/about_page.html">About</a></li>
<li><a href="file:///Users/tamborine/Downloads/the_therapist_page.html">The Therapist</a></li>
<li><a href="file:///Users/tamborine/Downloads/pay_what_you_can_page.html">Pay what you can</a></li>
<li><a href="file:///Users/tamborine/Downloads/projects_we_support_page.html">Projects we support</a></li>
<li><a href="file:///Users/tamborine/Downloads/resources_page.html">Resources</a></li>
<li><a href="file:///Users/tamborine/Downloads/prices_pag.html">Prices</a></li>
<li><a href="file:///Users/tamborine/Downloads/faq_page.html">FAQ</a></li>
</ul>
      

Run codeHide result


+1


source


Try to enter all the folder names in small. And change in html also, I ran into this a couple of times

0


source


I am assuming that you understand that you are linking to files on your computer - it will not work if you try to host your web page on the Internet, but it will work if you open the files locally.

I also assume that all the files you are trying to link are actually present in the download folder.

My guess is there is a typo in the file path. It could be a case sensitivity issue, a file extension issue, or something else. The easiest way to eliminate this possibility is to open the file you want to link to in your browser. You might be able to just double click on it, but if that doesn't work, you can open your browser and use file

> open

(or ctrl+O

/ cmd+o

). When the file is open, select everything in the URL bar and copy / paste it directly into your HTML. Do this for all the pages you link to, and if the links still don't work, something else is wrong and we'll need more information.

0


source







All Articles