Error when try to link one web page to another:(

Amazin

Free Member
Mar 24, 2009
546
26
40
Leytonstone, South London




This is so annoying, I'm trying to do some DIY learning and everything is going well until now. I've create 2 pages so far and I've created a link "about" inside "home". here are the codes I've entered:

"<header>
<link rel="stylesheet" type="text/css" href="mydesign.css">


<H1>This is my world</H1>

<nav>
<a href="about.html">about</a>
</nav>
</header>"

I've also experiemented with About/about.html but still keep getting that error:(

any idea why?
 
K, is it "about.html" or "About.html" ( Notice the uppercase 'A' )

Also, Just a quick lesson.

Using "about.html" means an absolute link , Ie: The "about.html" is in the same directory as index.html.

As a tip. I would say keep all files lowercase. It just makes life easy when you host on a filesystem that bitches about upper and lowercase.

As long as index.html and about.html are in the same directory, All should work fine. Just doublesheck your Upper and lowercases.

Also,
If you want to test and play about with HTML and websites, install "WAMP"
http://www.wampserver.com/en/

It will create a webserver on your local machine, It will install MYsql and PHP for scripting ( when you learn a bit more )

You can control the wamp server from the system tray ( next to the windows clock, bottom right )

Essentially, Once installed, you put your files in somewhere like c:/www/ and then open a browser and browse to http://localhost

It will act like a "real" server and means you likely wont get this strange issues when trying to test stuff locally.

Just my thoughts here and helpful advice from someone who has been there many years ago.
 
  • Like
Reactions: Amazin
Upvote 0
There is nothing wrong with what you've typed.
What happens if you double click on the About.html from that folder - does the page open in Firefox? If it does, does what appears in the url bar match up 100% with what you typed for the link?

Something that happened to me once when starting out with code: I copied and pasted an example to work with and it failed. Eventually I discovered that the double quotes symbols used in the tutorial were of an unusual kind and not suitable for coding with. I just deleted them and used the usual quotes symbol from my keyboard and it was fixed.

I wouldn't bother with a wamp server at this stage tbh. It's not necessary.

FWIW I just copied and pasted your above code into a new index.html file and created an about.html in the same folder and it worked in Firefox, with both about and About. I also tested out the blank space you have in the folder name, but Firefox wasn't bothered about that either.
 
  • Like
Reactions: Amazin
Upvote 0
thank you so much guys, I really appreciate the feedback and I finally discovered what went wrong after more experimenting. Basically the the "about" file is automatically saved as "about.html". I found that out after I right clicked on it and checked out its properties. So I went back and change it to "about.html" in the <a> tag without changing the name of file to "about.html" as well. So simply by keeping it as "about" instead of "about.html.html" did the trick. I was happy and reliefed
 
Upvote 0
thank you so much guys, I really appreciate the feedback and I finally discovered what went wrong after more experimenting. Basically the the "about" file is automatically saved as "about.html". I found that out after I right clicked on it and checked out its properties. So I went back and change it to "about.html" in the <a> tag without changing the name of file to "about.html" as well. So simply by keeping it as "about" instead of "about.html.html" did the trick. I was happy and reliefed

Ahhhhh
AHha.. yeah.
Probably a good idea to remove the "Hide file extensions" in your windows explorer...
 
Upvote 0
Some time even a silly mistake like this give a lot of headache to experts and force to think what exactly is going wrong. I have also faced same issue but was able to find sooner.
 
Upvote 0

Latest Articles