user3170022
user3170022

Reputation: 13

Linking to a file in a folder by clicking on an image

Basically I am trying to link to 2 local files that are webpages that are uploaded on the same host as the webpage being browsed. It's supposed to happen by clicking on one of these two images - Imgur. What am I doing wrong? I cannot click on the images to open the file in a new tab.

Here are my folders - Imgur

This is the code -

<div class="wrapper">
    <a href="MyIndia/index.html" target="_blank"><img src="images/slide3/MyIndia.png" data-stellar-ratio="1.8" data-stellar-vertical-offset="-200" alt=""></a>
</div>
<div class="wrapper">
    <a href="PizzaCat/index.html" target="_blank"><img src="images/slide3/PizzaCat.png" data-stellar-ratio="1.8" data-stellar-vertical-offset="-35" alt=""></a>
</div>

Upvotes: 1

Views: 453

Answers (3)

rubo77
rubo77

Reputation: 20835

This is the code that should work:

<div class="wrapper">
<a href="PizzaCat/index.html" target="_blank"><img src="images/slide3/MyIndia.png" data-stellar-ratio="1.8" data-stellar-vertical-offset="-200" alt=""></a>
</div>
...

And be sure of these details:

  • all files online should be readable by Apache (or whichever webserver you are using)
  • all names and folders are case-sensitive
  • look, if you haven't any trailing spaces in none of your filenames (like "PizzyCat " with a space at the end or such)
  • check if you really uploaded all your files to the webserver

Upvotes: 1

Mannan Chaudhary
Mannan Chaudhary

Reputation: 1

Pass the path as shown below:

<a href="C:\Users\Toni Moni\Downloads\fol.html" target="_blank"><img src="images/slide3/PizzaCat.png" data-stellar-ratio="1.8" data-stellar-vertical-offset="-35" alt=""></a>

Upvotes: 0

fnostro
fnostro

Reputation: 4591

from your code posted, most likely your href's have a wrong relative path

run your page, and assuming you're using a modern browser, press F12 an examine the link elements to see if the paths make any sense based on your site root.

Upvotes: 0

Related Questions