The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Need help using hyperlinks, Can't figure out how to link different html pages to eachother
Nickola
post Oct 5 2013, 01:18 PM
Post #1





Group: Members
Posts: 3
Joined: 5-October 13
Member No.: 19,816



I got a beginners textbook and so I just got into learning HTML. It's all been surprising simple and easy up until this point. Currently I'm trying to layout a (very) simple webpages where you click "Page One" and it takes you to a new page. I'm able to link to other internet pages easily, but not one offline. So I've been opening up my HTML files with Firefox/Chrome to see how it looks and if it works. When I try to link to another HTML document, I get this error after clicking the hyperlink. "Firefox can't find the file at /C:/Users/NAME/Desktop/NAME's Stuff/HTML Pages/HTML#1.html"

Here's what the code looks like for the page:

<html>
<a href="HTML#1.html">First Page</a>
</html>

The pages are all in the same folder which is why I didn't specify the file location. I moved them into the same folder because it wasn't working for me before when they were in different folders so I thought this would help.

How the folder is laid out:
>HTML Practice Pages
>HTML#1
>HTML#2
and so on.

Any help?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Oct 5 2013, 01:38 PM
Post #2


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,132
Joined: 9-August 06
Member No.: 6



# is a reserved character in URLs. It's used to denote a fragment identifier, commonly called an anchor. You use it if you want to link to a specific spot in a document. See further: http://htmlhelp.com/faq/html/links.html#named-anchor .

Anyway, the browser goes to look for a document called plainly "HTML", which likely doesn't exist. Had it found it it would then have gone on to look for the fragment identifier "1.html" in that document.

So, don't use hash signs in URLs except to indicate fragment identifiers. wink.gif

You can use a few more characters then these, but if you want a safe list that's easy to remember stick to letters a-z and A-Z, numbers, period, hyphen and underscore.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Nickola
post Oct 5 2013, 01:44 PM
Post #3





Group: Members
Posts: 3
Joined: 5-October 13
Member No.: 19,816



QUOTE(pandy @ Oct 5 2013, 01:38 PM) *

# is a reserved character in URLs. It's used to denote a fragment identifier, commonly called an anchor. You use it if you want to link to a specific spot in a document. See further: http://htmlhelp.com/faq/html/links.html#named-anchor .

Anyway, the browser goes to look for a document called simply "HTML", whick likely doesn't exist. Had it found it it would then have gone on to look for the fragment identifier "1.html" in that document.

So, don't use hash signs in URLs except to indicate fragment identifiers. wink.gif

Wow thanks. Knew it was something simple.

Thanks a bunch. Quick question. How do I mark this as solved? It's my first time on this forum

This post has been edited by Nickola: Oct 5 2013, 01:45 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Oct 5 2013, 01:47 PM
Post #4


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,132
Joined: 9-August 06
Member No.: 6



We don't do that around here. You or someone else can continue to post in this thread further on, should the need arise.

Also, I added a list of safe characters in my post above but wasn't quick enough so you had time to post. Stick to those if you don't want to bother to look things up.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Oct 5 2013, 02:11 PM
Post #5


.
********

Group: WDG Moderators
Posts: 8,043
Joined: 10-August 06
Member No.: 7



Also note that letters in URLs are case-sensitive on some servers but not on others, so it's safest to always be careful with case.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Nickola
post Oct 5 2013, 03:17 PM
Post #6





Group: Members
Posts: 3
Joined: 5-October 13
Member No.: 19,816



Alright. Thanks for the help happy.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 17th February 2019 - 01:28 PM