Jump to content

Links Look and Act Right, but do not link


Rank Beginner

Recommended Posts

I am following the Beginners Video #10 at 8 minutes.

 

I created my links and copied them per directions. They look like links and act like links, but when I click on them I get the "Internet Explorer Cannot Display the Webpage" error message.

 

Here is what my code looks like. I've named my files slightly differently than the video speaker has named his, but I've triple checked my file names and they are correct:

 

<li><a href="ProductList.html">Products</a></li>

<li><a href="CSS.html">CSS</a></li>

<li><a href="Tables.html">Tables Tutorial</a></li>

 

All of my files created during this course are on my desktop on my PC running Windows XP.

 

How does the browser know to look on my desktop for the pages that I've tried to link? I didn't give any instructions in my coding about where the files were.

 

Can anyone point out what I'm missing? Thanks!

Link to comment
Share on other sites

Rank Beginner put them on your shared server or server in your root directory. When you have your domain it will link to them in your root. It would come up as http://www.yoursite.com/productlist.html on the web.

 

 

<li><a href="/productlist.html">Products</a></li>

<li><a href="/blah.css">CSS</a></li>

<li><a href="/tables.html">Tables Tutorial</a></li>

 

PS if you want a css file you name it blah.css

Link to comment
Share on other sites

Here's one thing to check that often trips beginners up... By default, Windows hides the file extensions on file types. So, if you have that set, it's possible that your "productlist.html" file is actually named "productlist.html.html" or "productlist.html.txt" which is causing issues. I talk more about this issue and how to fix it here:

 

http://www.killersites.com/community/index.php?/topic/3010-cant-open-my-website/page__gopid__16509entry16509

Link to comment
Share on other sites

Just to pad out what others have said,

<a href="ProductList.html">Products</a>

is a relative link. To use this type of link the file with the link and the file you are trying to link to should be in the same folder, probably including your homepage or index file. If your files are in the Desktop, they should all be there, although most people would set up a separate folder just for their website.

 

When you upload to a server, files with that type of link need to be in the root directory because you haven't stated any sub-directory like directory2

<a href="directory2/ProductList.html">Products</a>

where ProductList.html would be in the sub-directory.

 

Webkiller's suggestion of

<a href="/ProductList.html">Products</a>

is a root-relative link because of the first / and it means that the html file with the link in it can be in the root directory or a sub-directory or a sub-sub-directory and the link will always go back to the root directory to look for ProductList.html but in your case you won't need to use the root-relative method if you don't have any sub-folders (sub-directories). Root-relative links have the disadvantage that they usually don't work on your computer because the root is C:\ and the file you are looking for is unlikely to be in that folder. However, root-relative links are useful for the online page where the root directory is the directory you have put your files in. It just makes checking your website on your computer difficult because the links don't work, but they do online.

 

Check the extension like falkencreative says and delete any extra extension that may have been automatically added.

Edited by Wickham
Link to comment
Share on other sites

Here's one thing to check that often trips beginners up... By default, Windows hides the file extensions on file types. So, if you have that set, it's possible that your "productlist.html" file is actually named "productlist.html.html" or "productlist.html.txt" which is causing issues. I talk more about this issue and how to fix it here:

 

http://www.killersites.com/community/index.php?/topic/3010-cant-open-my-website/page__gopid__16509entry16509

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...