0

I am trying to make an href button that when clicked changes the image on my website page to another image. How precisely can I do this?

I am trying to use the following code to point "Page 2" to page 2.html doc in my files as to change the image. The file cannot be found however.

<a href=“<a href=“page 2.html”> Page 2</a>

I do apologize if I am vague/if this question has been answered in past--Stack has been immensely helpful for answering my questions in past but I am just very confused as to how to solve this.

Thank you

Jeremy
  • 2,642
  • 18
  • 36
jay59
  • 1
  • 1
  • 1
  • I think this should answer your question http://stackoverflow.com/questions/4172579/html-href-syntax-is-it-okay-to-have-space-in-file-name – user3400885 Mar 11 '14 at 01:49

3 Answers3

1

correct syntax:

<a href="file" >link to be seen on page </a>

so for you:

<a href="page2.html"> Page 2</a>

If the file has a space in it, you should put a %20 where the space is:

href="page%202.html
Snappawapa
  • 1,697
  • 3
  • 20
  • 42
  • I'm afraid that that the page 2.html file still cannot be found when I click on it. Is this a problem because it cannot find page 2.html within the folder on my desktop? I am using a Mac--I'm not sure if that means I have to be more specific as to local file location. Thanks. – jay59 Mar 11 '14 at 03:13
  • it should work if the files are both in the same folder. to troubleshoot you might want to remove the space, just to remove a possible problem – Snappawapa Mar 11 '14 at 11:34
0

page 2.html shouldn't contain any spaces. Consider this: <a href="page2.html">Page 2</a>

0

If this is not still working <a href="page2.html">page 2</a> , try to input the whole file path. eg. <a href="C:\Users\Me\Desktop\folder\page2.html">page 2</a> . You may also refer here

slek
  • 309
  • 6
  • 17